mirror of
https://github.com/gristlabs/grist-core.git
synced 2026-03-02 04:09:24 +00:00
(core) Webhook event queue on redis
Summary: Push webhook events to redis queue with key based on docId. Remove events from redis after sending using LTRIM. Put failed events back on the end of the queue under normal circumstances. When the event queue gets too long: - Wait until it gets consumed before continuing. - Drop failed events (i.e. don't put them back on the end of the queue) - Limit webhook retries to 5 Test Plan: Tested that interactions with redis are as expected using redis MONITOR command. Reviewers: paulfitz Reviewed By: paulfitz Differential Revision: https://phab.getgrist.com/D3100
This commit is contained in:
4
stubs/app/server/declarations.d.ts
vendored
4
stubs/app/server/declarations.d.ts
vendored
@@ -52,6 +52,8 @@ declare module "redis" {
|
||||
public ttlAsync(key: string): Promise<number|null>;
|
||||
public unwatchAsync(): Promise<'OK'>;
|
||||
public watchAsync(key: string): Promise<void>;
|
||||
public lrangeAsync(key: string, start: number, end: number): Promise<string[]>;
|
||||
public rpushAsync(key: string, ...vals: string[]): Promise<number>;
|
||||
}
|
||||
|
||||
class Multi {
|
||||
@@ -67,5 +69,7 @@ declare module "redis" {
|
||||
public smembers(key: string): Multi;
|
||||
public srandmember(key: string): Multi;
|
||||
public srem(key: string, val: string): Multi;
|
||||
public rpush(key: string, ...vals: string[]): Multi;
|
||||
public ltrim(key: string, start: number, end: number): Multi;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user