mirror of
https://github.com/Chocobozzz/PeerTube.git
synced 2025-10-04 10:19:35 +02:00
Refactor getOrCreateAPVideo
This commit is contained in:
parent
c56faf0d94
commit
304a84d59c
19 changed files with 243 additions and 209 deletions
|
@ -102,6 +102,10 @@ function getFollowsSort (value: string, lastSort: OrderItem = [ 'id', 'ASC' ]):
|
|||
}
|
||||
|
||||
function isOutdated (model: { createdAt: Date, updatedAt: Date }, refreshInterval: number) {
|
||||
if (!model.createdAt || !model.updatedAt) {
|
||||
throw new Error('Miss createdAt & updatedAt attribuets to model')
|
||||
}
|
||||
|
||||
const now = Date.now()
|
||||
const createdAtTime = model.createdAt.getTime()
|
||||
const updatedAtTime = model.updatedAt.getTime()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue