提交了假数据,不需要

This commit is contained in:
2025-12-07 22:07:35 +08:00
parent 04d70ace99
commit 616fe10b02
5 changed files with 8 additions and 31 deletions
+5 -11
View File
@@ -321,17 +321,11 @@ def auto_import_csv_on_start():
flag = os.getenv('AUTO_IMPORT_ON_START', '1')
if str(flag) == '0':
return
paths = [
os.path.join("/app", "data", "import.csv"),
os.path.join(os.path.dirname(__file__), "..", "init", "revenue.csv"),
os.path.join(os.path.dirname(__file__), "..", "init", "revenue.sample.csv"),
]
for p in paths:
if os.path.exists(p):
with open(p, "r", encoding="utf-8") as f:
text = f.read()
import_csv_text(text, actor='bootstrap')
break
p = os.path.join("/app", "data", "import.csv")
if os.path.exists(p):
with open(p, "r", encoding="utf-8") as f:
text = f.read()
import_csv_text(text, actor='bootstrap')
def sync_log_to_db():
"""启动时将 app.log 中缺失的数据同步到 DB(只同步今天之前)"""