mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-05-28 11:31:55 +02:00
Extract getEndDateForRPO method to utils
This will allow sharing with other functionality. GitOrigin-RevId: a6e11447180511cc3741ca03f4996ef7ceb45ea5
This commit is contained in:
@@ -11,6 +11,13 @@ export function objectIdFromDate(time) {
|
||||
return ObjectId.createFromTime(time.getTime() / 1000)
|
||||
}
|
||||
|
||||
/**
|
||||
* @return {Date}
|
||||
*/
|
||||
export function getEndDateForRPO() {
|
||||
return new Date(Date.now() - RPO)
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a startDate, endDate pair that checks a period of time before the RPO horizon
|
||||
*
|
||||
|
||||
@@ -15,19 +15,12 @@ import path from 'node:path'
|
||||
import projectKey from './project_key.js'
|
||||
import streams from './streams.js'
|
||||
import objectPersistor from '@overleaf/object-persistor'
|
||||
import { RPO } from '../../backupVerifier/utils.mjs'
|
||||
import { getEndDateForRPO } from '../../backupVerifier/utils.mjs'
|
||||
|
||||
/**
|
||||
* @typedef {import("@overleaf/object-persistor/src/PerProjectEncryptedS3Persistor.js").CachedPerProjectEncryptedS3Persistor} CachedPerProjectEncryptedS3Persistor
|
||||
*/
|
||||
|
||||
/**
|
||||
* @return {Date}
|
||||
*/
|
||||
export function getEndDateForRPO() {
|
||||
return new Date(Date.now() - RPO)
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {string} historyId
|
||||
* @param {string} hash
|
||||
|
||||
Reference in New Issue
Block a user