perf: vault 同步日志 (#11278)

Co-authored-by: feng <1304903146@qq.com>
pull/11282/head
fit2bot 1 year ago committed by GitHub
parent 1f8428ac1c
commit 7ba261c4f0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -1,5 +1,5 @@
import datetime
from concurrent.futures import ThreadPoolExecutor, as_completed
from datetime import datetime
from celery import shared_task
from django.utils.translation import gettext_lazy as _
@ -38,7 +38,7 @@ def sync_secret_to_vault():
failed, skipped, succeeded = 0, 0, 0
to_sync_models = [Account, AccountTemplate, Account.history.model]
print('\033[33m>>> 开始同步密钥数据到 Vault ({})'.format(datetime.datetime.now()))
print(f'\033[33m>>> 开始同步密钥数据到 Vault ({datetime.now().strftime("%Y-%m-%d %H:%M:%S")})')
with tmp_to_root_org():
instances = []
for model in to_sync_models:
@ -65,5 +65,5 @@ def sync_secret_to_vault():
f'失败: {failed}, '
f'跳过: {skipped}'
)
print('\033[33m>>> 全部同步完成 ({})'.format(datetime.datetime.now()))
print(f'\033[33m>>> 全部同步完成 ({datetime.now().strftime("%Y-%m-%d %H:%M:%S")})')
print('\033[0m')

Loading…
Cancel
Save