[history-v1] use POST requests for expiring redis buffer from cron (#26568)

* [history-v1] use POST requests for expiring redis buffer from cron

(cherry picked from commit 15780ac54e36b96e1aed9fd9eb6dfe9d4fbf842f)

* [history-v1] remove double claim of expire job

GitOrigin-RevId: 8b2eab07006a5819a47eed3f646b2a4d75f86e5b
This commit is contained in:
Jakob Ackermann
2025-07-08 08:05:47 +00:00
committed by Copybot
parent d57d0ca738
commit cf472f54d0
5 changed files with 154 additions and 3 deletions
@@ -28,6 +28,7 @@ const InvalidChangeError = storage.InvalidChangeError
const render = require('./render')
const Rollout = require('../app/rollout')
const redisBackend = require('../../storage/lib/chunk_store/redis')
const rollout = new Rollout(config)
rollout.report(logger) // display the rollout configuration in the logs
@@ -177,6 +178,13 @@ async function flushChanges(req, res, next) {
}
}
async function expireProject(req, res, next) {
const projectId = req.swagger.params.project_id.value
await redisBackend.expireProject(projectId)
res.status(HTTPStatus.OK).end()
}
exports.importSnapshot = expressify(importSnapshot)
exports.importChanges = expressify(importChanges)
exports.flushChanges = expressify(flushChanges)
exports.expireProject = expressify(expireProject)