Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: 修复发送周期任务通知编辑时间为空报错问题 #7364 #7443

Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion gcloud/core/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,7 @@ def scan_periodic_task(is_send_notify: bool = True):
"task__creator",
"project__id",
"project__name",
"create_time",
"edit_time",
"task__last_run_at",
"task__name",
Expand All @@ -183,7 +184,8 @@ def scan_periodic_task(is_send_notify: bool = True):
last_month_time = datetime.datetime.now() + dateutil.relativedelta.relativedelta(
months=-int(settings.PERIODIC_TASK_REMINDER_TIME)
)
if last_month_time.timestamp() < p_task["edit_time"].timestamp():
edit_time = p_task["edit_time"] if p_task["edit_time"] else p_task["create_time"]
if last_month_time.timestamp() < edit_time.timestamp():
continue
creator = p_task["task__creator"]
project_name = p_task["project__name"]
Expand Down
Loading