Merge pull request #18167 from overleaf/em-simpler-typescript-backend

Simpler Typescript setup in the backend

GitOrigin-RevId: 3a90f26a5ac8029d14203faa98008375ce933e7d
This commit is contained in:
Eric Mc Sween
2024-05-07 08:04:00 +00:00
committed by Copybot
parent 5da8662fa8
commit e87df4a791
43 changed files with 63 additions and 155 deletions
+12
View File
@@ -96,6 +96,9 @@ module.exports = class RedisLocker {
return `locked:host=${HOST}:pid=${PID}:random=${RND}:time=${time}:count=${COUNT++}`
}
/**
* @param {Callback} callback
*/
tryLock(id, callback) {
if (callback == null) {
callback = function () {}
@@ -135,6 +138,9 @@ module.exports = class RedisLocker {
)
}
/**
* @param {Callback} callback
*/
getLock(id, callback) {
if (callback == null) {
callback = function () {}
@@ -166,6 +172,9 @@ module.exports = class RedisLocker {
attempt()
}
/**
* @param {Callback} callback
*/
checkLock(id, callback) {
if (callback == null) {
callback = function () {}
@@ -186,6 +195,9 @@ module.exports = class RedisLocker {
})
}
/**
* @param {Callback} callback
*/
releaseLock(id, lockValue, callback) {
const key = this.getKey(id)
return this.rclient.eval(