perf: Change secret after successful login

pull/15558/head
feng 2025-06-11 18:35:17 +08:00 committed by ZhaoJiSen
parent c2b44cfd84
commit 79c2284a01
2 changed files with 3 additions and 4 deletions

View File

@ -73,9 +73,8 @@ def change_secret_accounts_to_assets_task(account_ids, params=None, snapshot=Non
if trigger == 'delay':
for _id in manager.account_ids:
status = manager.get_status(_id)
ttl = manager.get_ttl(_id)
# Check if the account is in QUEUED status
if status == ChangeSecretAccountStatus.QUEUED and ttl <= 15:
if status == ChangeSecretAccountStatus.QUEUED:
account_ids.append(_id)
manager.set_status(_id, ChangeSecretAccountStatus.READY)

View File

@ -71,7 +71,7 @@ class AccountSecretTaskStatus:
prefix='queue:change_secret:',
debounce_key='debounce:change_secret:task',
debounce_timeout=10,
queue_status_timeout=35,
queue_status_timeout=60,
default_timeout=3600,
delayed_task_countdown=20,
):
@ -114,7 +114,7 @@ class AccountSecretTaskStatus:
data.update(metadata)
if use_add:
return cache.set(key, data, timeout or self.queue_status_timeout)
return cache.add(key, data, timeout or self.queue_status_timeout)
cache.set(key, data, timeout or self.default_timeout)