Extract getEndDateForRPO method to utils

This will allow sharing with other functionality.

GitOrigin-RevId: a6e11447180511cc3741ca03f4996ef7ceb45ea5
This commit is contained in:
Andrew Rumble
2025-03-26 10:41:10 +00:00
committed by Copybot
parent ced1e76724
commit 4e575f5ee0
2 changed files with 8 additions and 8 deletions

View File

@@ -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
*

View File

@@ -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