diff options
| author | Hazelnoot <acomputerdog@gmail.com> | 2024-11-18 01:24:23 -0500 |
|---|---|---|
| committer | Hazelnoot <acomputerdog@gmail.com> | 2025-02-16 19:25:04 -0500 |
| commit | 871c63b48bd958d301f709260dbb01273462da57 (patch) | |
| tree | bffffbe0c554a5b8fef705ed6503d632135189b5 /packages/backend/src/queue | |
| parent | log inbound activity duration (diff) | |
| download | sharkey-871c63b48bd958d301f709260dbb01273462da57.tar.gz sharkey-871c63b48bd958d301f709260dbb01273462da57.tar.bz2 sharkey-871c63b48bd958d301f709260dbb01273462da57.zip | |
print warning when activity processing exceeds 10 seonds
Diffstat (limited to 'packages/backend/src/queue')
| -rw-r--r-- | packages/backend/src/queue/processors/InboxProcessorService.ts | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/packages/backend/src/queue/processors/InboxProcessorService.ts b/packages/backend/src/queue/processors/InboxProcessorService.ts index 242c67359b..1dcce0ffc2 100644 --- a/packages/backend/src/queue/processors/InboxProcessorService.ts +++ b/packages/backend/src/queue/processors/InboxProcessorService.ts @@ -105,6 +105,9 @@ export class InboxProcessorService implements OnApplicationShutdown { // Truncate nanoseconds to microseconds, then scale to milliseconds. // 123,456,789 ns -> 123,456 us -> 123.456 ms const duration = Number((endTime - startTime) / 1000n) / 1000; + if (duration > 10000) { + this.logger.warn(`Activity ${JSON.stringify(payload.id)} by "${keyId}" took ${(duration / 1000).toFixed(1)} seconds to complete`); + } log.accepted = result.startsWith('ok'); log.duration = duration; |