mirror of
https://github.com/fosrl/pangolin.git
synced 2026-10-28 22:49:07 +01:00
Improve latency on register messages for olm
This commit is contained in:
@@ -20,6 +20,7 @@ export interface RebuildQueueManager {
|
||||
enqueue(job: RebuildJob): Promise<void>;
|
||||
startProcessing(handlers: RebuildJobHandlers): void;
|
||||
isQueued(job: RebuildJob): Promise<boolean>;
|
||||
anyQueued(jobs: RebuildJob[]): Promise<boolean>;
|
||||
}
|
||||
|
||||
// In-process FIFO used when there is no Redis to back a distributed queue
|
||||
@@ -48,6 +49,10 @@ class InMemoryRebuildQueue implements RebuildQueueManager {
|
||||
return this.queuedSet.has(dedupeKey(job));
|
||||
}
|
||||
|
||||
async anyQueued(jobs: RebuildJob[]): Promise<boolean> {
|
||||
return jobs.some((job) => this.queuedSet.has(dedupeKey(job)));
|
||||
}
|
||||
|
||||
async enqueue(job: RebuildJob): Promise<void> {
|
||||
const key = dedupeKey(job);
|
||||
if (this.queuedSet.has(key)) {
|
||||
|
||||
Reference in New Issue
Block a user