Add protocol to cache warmup (#8721)

* Add protocol to cache warmup

* Update unit tests

* Fix wrong commit

* Update UPDATING.md

* Fix pylint
This commit is contained in:
Beto Dealmeida 2019-12-03 10:51:06 -08:00 committed by GitHub
parent fce49680d7
commit f8e15e1c55
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 13 additions and 4 deletions

View File

@ -21,13 +21,19 @@ under the License.
This file documents any backwards-incompatible changes in Superset and
assists people when migrating to a new version.
## Next
* [8721](https://github.com/apache/incubator-superset/pull/8721): When using the cache
warmup Celery task you should now specify the `SUPERSET_WEBSERVER_PROTOCOL` variable
in your configuration (probably either "http" or "https"). This defaults to "http".
## 0.35.0
* [8512](https://github.com/apache/incubator-superset/pull/8512): `DRUID_IS_ACTIVE` now
defaults to False. To enable Druid-API-based functionality, override the
`DRUID_IS_ACTIVE` configuration variable by setting it to `True` for your deployment.
* [8450](https://github.com/apache/incubator-superset/pull/8450): The time ranger picker
* [8450](https://github.com/apache/incubator-superset/pull/8450): The time range picker
now uses UTC for the tooltips and default placeholder timestamps (sans timezone).
* [8370](https://github.com/apache/incubator-superset/pull/8370): Deprecates

View File

@ -93,6 +93,7 @@ FILTER_SELECT_ROW_LIMIT = 10000
SUPERSET_WORKERS = 2 # deprecated
SUPERSET_CELERY_WORKERS = 32 # deprecated
SUPERSET_WEBSERVER_PROTOCOL = "http"
SUPERSET_WEBSERVER_ADDRESS = "0.0.0.0"
SUPERSET_WEBSERVER_PORT = 8088

View File

@ -75,8 +75,10 @@ def get_form_data(chart_id, dashboard=None):
def get_url(chart):
"""Return external URL for warming up a given chart/table cache."""
with app.test_request_context():
baseurl = "{SUPERSET_WEBSERVER_ADDRESS}:{SUPERSET_WEBSERVER_PORT}".format(
**app.config
baseurl = (
"{SUPERSET_WEBSERVER_PROTOCOL}://"
"{SUPERSET_WEBSERVER_ADDRESS}:"
"{SUPERSET_WEBSERVER_PORT}".format(**app.config)
)
return f"{baseurl}{chart.url}"

View File

@ -29,7 +29,7 @@ from superset.tasks.cache import (
from .base_tests import SupersetTestCase
URL_PREFIX = "0.0.0.0:8081"
URL_PREFIX = "http://0.0.0.0:8081"
class CacheWarmUpTests(SupersetTestCase):