fix: timezone bug
This commit is contained in:
parent
5ebf2bde24
commit
2690895231
|
|
@ -16,6 +16,7 @@ import asyncio
|
|||
import sys
|
||||
import os
|
||||
from django.db.models import Q
|
||||
from django.utils import timezone
|
||||
|
||||
# config.email = "caoqianming@foxmail.com"
|
||||
config.email = "caoqianming@ctc.ac.cn"
|
||||
|
|
@ -368,7 +369,7 @@ def release_working_paper(minutes=10):
|
|||
qs = Paper.objects.filter(fetch_status="downloading")
|
||||
count = 0
|
||||
for paper in qs:
|
||||
if paper.update_time < datetime.now() - timedelta(minutes=minutes):
|
||||
if paper.update_time < timezone.now() - timedelta(minutes=minutes):
|
||||
paper.fetch_end()
|
||||
count += 1
|
||||
return f"release {count} papers"
|
||||
|
|
|
|||
Loading…
Reference in New Issue