poller fixes per profil

This commit is contained in:
Mateusz Gruszczyński
2026-06-20 18:39:00 +02:00
parent e1b5822a59
commit d4c9150c42
7 changed files with 129 additions and 35 deletions
+4 -2
View File
@@ -203,9 +203,11 @@ def start_scheduler(socketio=None) -> None:
profile_id = int(row["profile_id"])
with connect() as conn:
owner = conn.execute("SELECT user_id FROM rtorrent_profiles WHERE id=?", (profile_id,)).fetchone()
profile = get_profile(profile_id, int(owner["user_id"] if owner and owner.get("user_id") else default_user_id()))
owner_id = int(owner["user_id"] if owner and owner.get("user_id") else default_user_id())
profile = get_profile(profile_id, owner_id)
if profile:
result = check(profile, only_due=True)
# Note: RSS jobs run with the profile owner in background mode, independent of browser activity.
result = check(profile, user_id=owner_id, only_due=True)
if socketio and result.get("queued"):
socketio.emit("rss_checked", {"profile_id": profile["id"], **result}, to=f"profile:{profile['id']}")
except Exception: