feat: separate configuration
This commit is contained in:
@@ -6,14 +6,10 @@ import datetime
|
||||
import logging
|
||||
import os
|
||||
import re
|
||||
from config import PROJECT_DEADLINES
|
||||
|
||||
app = Flask(__name__)
|
||||
|
||||
project_deadlines = {
|
||||
"experiment_knn": "2024-10-20 23:59:59",
|
||||
"experiment_logreg": "2024-11-03 23:59:59",
|
||||
}
|
||||
|
||||
# 上传文件的路径
|
||||
UPLOAD_FOLDER = "./uploads"
|
||||
os.makedirs(UPLOAD_FOLDER, exist_ok=True)
|
||||
@@ -120,7 +116,7 @@ def is_past_deadline(project):
|
||||
# 当前时间
|
||||
current_time = datetime.datetime.now()
|
||||
# 截止时间
|
||||
deadline_str = project_deadlines.get(project)
|
||||
deadline_str = PROJECT_DEADLINES.get(project)
|
||||
|
||||
if deadline_str:
|
||||
deadline = datetime.datetime.strptime(deadline_str, "%Y-%m-%d %H:%M:%S")
|
||||
|
||||
Reference in New Issue
Block a user