Skip to content

Commit

Permalink
fix change detection in sync()
Browse files Browse the repository at this point in the history
  • Loading branch information
Kunsi committed Dec 25, 2023
1 parent fa9f16b commit 8b6db21
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions frontend.py
Original file line number Diff line number Diff line change
Expand Up @@ -432,16 +432,17 @@ def asset_to_tiles(asset):
for setup_id in app.config["SETUP_IDS"]:
log.info("[Setup {}] Getting old config".format(setup_id))
config = ib.get(f"setup/{setup_id}")["config"][""]

old_config = config.copy()
setup_changed = False

for schedule in config["schedules"]:
if schedule["name"] == "User Content":
log.info('[Setup {}] Found schedule "User Content"'.format(setup_id))

schedule["pages"] = pages
if pages != schedule["pages"]:
schedule["pages"] = pages
setup_changed = True

if old_config != config:
if setup_changed:
log.info("[Setup {}] Config has changed, updating".format(setup_id))
ib.post(
f"setup/{setup_id}",
Expand Down

0 comments on commit 8b6db21

Please sign in to comment.