Skip to content

Commit

Permalink
Add protocol to cache warmup (apache#8721)
Browse files Browse the repository at this point in the history
* Add protocol to cache warmup

* Update unit tests

* Fix wrong commit

* Update UPDATING.md

* Fix pylint
  • Loading branch information
betodealmeida authored Dec 3, 2019
1 parent fce4968 commit f8e15e1
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 4 deletions.
8 changes: 7 additions & 1 deletion UPDATING.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions superset/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ def _try_json_readsha(filepath):
SUPERSET_WORKERS = 2 # deprecated
SUPERSET_CELERY_WORKERS = 32 # deprecated

SUPERSET_WEBSERVER_PROTOCOL = "http"
SUPERSET_WEBSERVER_ADDRESS = "0.0.0.0"
SUPERSET_WEBSERVER_PORT = 8088

Expand Down
6 changes: 4 additions & 2 deletions superset/tasks/cache.py
Original file line number Diff line number Diff line change
Expand Up @@ -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}"

Expand Down
2 changes: 1 addition & 1 deletion tests/strategy_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@

from .base_tests import SupersetTestCase

URL_PREFIX = "0.0.0.0:8081"
URL_PREFIX = "http://0.0.0.0:8081"


class CacheWarmUpTests(SupersetTestCase):
Expand Down

0 comments on commit f8e15e1

Please sign in to comment.