MCPcopy
hub / github.com/apache/superset / update_datasources_cache

Function update_datasources_cache

superset/cli.py:590–606  ·  view source on GitHub ↗

Refresh sqllab datasources cache

()

Source from the content-addressed store, hash-verified

588@superset.command()
589@with_appcontext
590def update_datasources_cache() -> None:
591 """Refresh sqllab datasources cache"""
592 # pylint: disable=import-outside-toplevel
593 from superset.models.core import Database
594
595 for database in db.session.query(Database).all():
596 if database.allow_multi_schema_metadata_fetch:
597 print("Fetching {} datasources ...".format(database.name))
598 try:
599 database.get_all_table_names_in_database(
600 force=True, cache=True, cache_timeout=24 * 60 * 60
601 )
602 database.get_all_view_names_in_database(
603 force=True, cache=True, cache_timeout=24 * 60 * 60
604 )
605 except Exception as ex: # pylint: disable=broad-except
606 print("{}".format(str(ex)))
607
608
609@superset.command()

Callers

nothing calls this directly

Calls 3

queryMethod · 0.45

Tested by

no test coverage detected