Skip to content

Commit

Permalink
NOCDEV-13463: deprioritize reload command if generator config is unch…
Browse files Browse the repository at this point in the history
…anged (#57)

* NOCDEV-13463: deprioritize reload command if generator config is unchanged

* Fix indentation

---------

Co-authored-by: Vlad Starostin <[email protected]>
  • Loading branch information
drtyrsa and Vlad Starostin authored Jul 10, 2024
1 parent 7a578e9 commit 5eec020
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions annet/generators/result.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,12 +105,17 @@ def new_json_fragment_files(
new_fragment,
result_acl,
)
if filepath in reload_prios and \
reload_prios[filepath] > generator_result.reload_prio:
if jsontools.format_json(new_config) == jsontools.format_json(previous_config):
# config is not changed, deprioritize reload_cmd
reload_prio = 0
else:
reload_prio = generator_result.reload_prio

if filepath in reload_prios and reload_prios[filepath] > reload_prio:
_, reload_cmd = files[filepath]
else:
reload_cmd = generator_result.reload
reload_prios[filepath] = generator_result.reload_prio
reload_prios[filepath] = reload_prio
files[filepath] = (new_config, reload_cmd)
return files

Expand Down

0 comments on commit 5eec020

Please sign in to comment.