diff --git a/services/history-v1/backupVerifier/utils.mjs b/services/history-v1/backupVerifier/utils.mjs index 00f09d7d82..4cd61f77b3 100644 --- a/services/history-v1/backupVerifier/utils.mjs +++ b/services/history-v1/backupVerifier/utils.mjs @@ -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 * diff --git a/services/history-v1/storage/lib/backupVerifier.mjs b/services/history-v1/storage/lib/backupVerifier.mjs index 919338c324..14b84cd320 100644 --- a/services/history-v1/storage/lib/backupVerifier.mjs +++ b/services/history-v1/storage/lib/backupVerifier.mjs @@ -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