fixed 日志排序按id

This commit is contained in:
“xxq250” 2022-08-10 10:24:53 +08:00
parent 3518c510e1
commit 1aea01d55f
2 changed files with 3 additions and 3 deletions

View File

@ -21,7 +21,7 @@ class LogDAO(MysqlAO):
async def fetch(self, cond: Any = None, limit: int = 0, start: int = 0) -> List[LogDO]:
stmt = select(self._DO_class).order_by(
self._DO_class.create_time.desc())
self._DO_class.id.desc())
if cond is not None:
stmt = stmt.where(cond)
if limit:

View File

@ -128,12 +128,12 @@ async def sync():
# if the job status is green, it means we can sync the job
if job.status == Color.green:
await Log(LogType.INFO,
f"The github branch {job.github_branch} from {job.project} is now syncing", job.id)
f"The gitlink branch {job.gitlink_branch} from {job.project} is now syncing", job.id)
task = asyncio.create_task(sync_job(job))
tasks.append(task)
else:
await Log(LogType.INFO,
f"The github branch {job.github_branch} from {job.project} does not need to sync", job.id)
f"The gitlink branch {job.gitlink_branch} from {job.project} does not need to sync", job.id)
for task in tasks:
await task
logger.info("End syncing ****************************")