From 7ba261c4f0a9e6a8f36b924ebb72b580d588d0a4 Mon Sep 17 00:00:00 2001 From: fit2bot <68588906+fit2bot@users.noreply.github.com> Date: Tue, 15 Aug 2023 10:32:03 +0800 Subject: [PATCH] =?UTF-8?q?perf:=20vault=20=E5=90=8C=E6=AD=A5=E6=97=A5?= =?UTF-8?q?=E5=BF=97=20(#11278)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: feng <1304903146@qq.com> --- apps/accounts/tasks/vault.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/apps/accounts/tasks/vault.py b/apps/accounts/tasks/vault.py index 5ada959d1..90e78cebf 100644 --- a/apps/accounts/tasks/vault.py +++ b/apps/accounts/tasks/vault.py @@ -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')