refactor(quota): canonical <entity>_<action> taxonomy for quota events
The quota-attribution action keys were inconsistent (mixed verbs, ad-hoc names, English-only labels). Introduce a QuotaAction constants holder (one source of truth), rename every attribution call site to it, and add migration 0020 to rename historical quota_events.action values. The display label now resolves from i18n (quotaActions.<key>, EN/HU/DE) instead of a hard-coded English map. Scheduler job ids and progress phase labels are a separate namespace and are left untouched.
This commit is contained in:
parent
1ce035ca9e
commit
b23f805533
12 changed files with 151 additions and 33 deletions
|
|
@ -387,7 +387,7 @@ def sync_all_playlists(db: Session) -> dict:
|
|||
progress.report(i, len(users), "playlist_sync")
|
||||
continue
|
||||
try:
|
||||
with quota.attribute(user.id, "playlist_sync"):
|
||||
with quota.attribute(user.id, quota.QuotaAction.PLAYLISTS_PULL):
|
||||
total += sync_user_playlists(db, user).get("synced", 0)
|
||||
except YouTubeError:
|
||||
db.rollback()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue