mirror of
https://github.com/omnivore-app/omnivore.git
synced 2026-03-11 08:54:26 +00:00
Change time
This commit is contained in:
parent
75365f4811
commit
c4b5739f3e
1 changed files with 13 additions and 2 deletions
|
|
@ -23,12 +23,12 @@ export const countExportsWithinMinute = async (
|
|||
})
|
||||
}
|
||||
|
||||
export const countExportsWithin24Hours = async (
|
||||
export const countExportsWithin6Hours = async (
|
||||
userId: string
|
||||
): Promise<number> => {
|
||||
return getRepository(Export).countBy({
|
||||
userId,
|
||||
createdAt: MoreThan(new Date(Date.now() - 24 * 60 * 60 * 1000)),
|
||||
createdAt: MoreThan(new Date(Date.now() - 6 * 60 * 60 * 1000)),
|
||||
state: In([TaskState.Pending, TaskState.Running, TaskState.Succeeded]),
|
||||
})
|
||||
}
|
||||
|
|
@ -42,3 +42,14 @@ export const findExportById = async (
|
|||
userId,
|
||||
})
|
||||
}
|
||||
|
||||
export const findExports = async (userId: string): Promise<Export[] | null> => {
|
||||
return getRepository(Export).find({
|
||||
where: {
|
||||
userId,
|
||||
},
|
||||
order: {
|
||||
createdAt: 'DESC',
|
||||
},
|
||||
})
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue