feat: auto lock (#18630)

* add delete to redis service

* auto lock + tests

* changes to autolock in api/book call

* remove log clutter

* add detection in api v1

* tpye changes

* throw error and add tests for API

* add response logic on locked + tests

* type response properly i hope?

* type fix

* add tests for counter not existing + redis errors

* remove IP - add sentry to track

* rename symbol

* fix type error

* fix tests

* remove sentry call spy

* fix type on sentry setUser call

---------

Co-authored-by: Alex van Andel <[email protected]>
This commit is contained in:
sean-brydonandAlex van Andel authored and GitHub committed 2025-01-18 16:21:12 -03:00
1 parent 4855b6b40f
commit b4a51d3560
7 files changed
+673 -6

No files matched your search

+2
View File
@@ -8,4 +8,6 @@ export interface IRedisService {
lrange: <TResult = string>(key: string, start: number, end: number) => Promise<TResult[]>;
lpush: <TData>(key: string, ...elements: TData[]) => Promise<number>;
del: (key: string) => Promise<number>;
}
+4
View File
@@ -13,6 +13,10 @@ export class RedisService implements IRedisService {
return this.redis.get(key);
}
async del(key: string): Promise<number> {
return this.redis.del(key);
}
async set<TData>(key: string, value: TData): Promise<"OK" | TData | null> {
// Implementation for setting value in Redis
return this.redis.set(key, value);