оптимизировал сохранение данных и загрузку задач из Redmine

This commit is contained in:
2026-07-06 16:11:41 +03:00
parent 64b347e966
commit 9a0ce15160
5 changed files with 101 additions and 109 deletions

View File

@@ -70,7 +70,8 @@ def db_update():
red_tasks = red.get_issues()
if red_tasks:
db_tasks = db.get_tasks()
clock_tasks = [task for task in red_tasks if task.id in [parse_task_id(tag.title) for tag in [*db_tags, *new_tags]]]
clock_task_ids = {parse_task_id(tag.title) for tag in [*db_tags, *new_tags]}
clock_tasks = [task for task in red_tasks if task.id in clock_task_ids]
new_tasks = [task for task in clock_tasks if task not in db_tasks]
if new_tasks: