Skip to content

Commit

Permalink
Merge pull request #301 from sysblok/feature/make-fetch-strings-with-…
Browse files Browse the repository at this point in the history
…config-reload

Added automatic string fetching when reloading the job config
  • Loading branch information
gisly authored Jan 22, 2024
2 parents cd200d7 + 216f8d3 commit e1dda30
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/tg/handlers/access_config_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,13 +77,25 @@ def reload_config_jobs(update, tg_context):
reply(load("access_config_handler__reload_config_jobs_usage_example"), update)
logger.warning(f"Failed to reload jobs config: {e}")
return
num_strings = 0
try:
num_strings = AppContext().strings_db_client.fetch_strings_sheet(
AppContext().sheets_client
)
except Exception as e:
reply(load("access_config_handler__reload_config_jobs_usage_example"), update)
logger.warning(f"Failed to reload jobs config when fetching strings: {e}")
reply(
load(
"common__code_wrapper",
arg=json.dumps(ConfigManager.redact(config_jobs), indent=2),
),
update,
)
reply(
load("db_fetch_strings_sheet_job__success", num_strings=num_strings),
update,
)


@admin_only
Expand Down

0 comments on commit e1dda30

Please sign in to comment.