提交了假数据,不需要
This commit is contained in:
+5
-11
@@ -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(只同步今天之前)"""
|
||||
|
||||
Reference in New Issue
Block a user