diff options
| author | okayurisotto <okayurisotto@proton.me> | 2023-07-08 07:08:16 +0900 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-07-08 07:08:16 +0900 |
| commit | d84796588c1472334ddaf696a817f015c245ce44 (patch) | |
| tree | 45caa2d8659d35b90bc3f36170e764aa5eb90b70 /packages/backend/src/queue/processors/WebhookDeliverProcessorService.ts | |
| parent | perf(backend): Improve performance of FetchInstanceMetadata (#11128) (diff) | |
| download | sharkey-d84796588c1472334ddaf696a817f015c245ce44.tar.gz sharkey-d84796588c1472334ddaf696a817f015c245ce44.tar.bz2 sharkey-d84796588c1472334ddaf696a817f015c245ce44.zip | |
cleanup: trim trailing whitespace (#11136)
* cleanup: trim trailing whitespace
* update(`.editorconfig`)
---------
Co-authored-by: syuilo <Syuilotan@yahoo.co.jp>
Diffstat (limited to 'packages/backend/src/queue/processors/WebhookDeliverProcessorService.ts')
| -rw-r--r-- | packages/backend/src/queue/processors/WebhookDeliverProcessorService.ts | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/packages/backend/src/queue/processors/WebhookDeliverProcessorService.ts b/packages/backend/src/queue/processors/WebhookDeliverProcessorService.ts index 8b40c16749..25e91761ef 100644 --- a/packages/backend/src/queue/processors/WebhookDeliverProcessorService.ts +++ b/packages/backend/src/queue/processors/WebhookDeliverProcessorService.ts @@ -31,7 +31,7 @@ export class WebhookDeliverProcessorService { public async process(job: Bull.Job<WebhookDeliverJobData>): Promise<string> { try { this.logger.debug(`delivering ${job.data.webhookId}`); - + const res = await this.httpRequestService.send(job.data.to, { method: 'POST', headers: { @@ -50,25 +50,25 @@ export class WebhookDeliverProcessorService { body: job.data.content, }), }); - + this.webhooksRepository.update({ id: job.data.webhookId }, { latestSentAt: new Date(), latestStatus: res.status, }); - + return 'Success'; } catch (res) { this.webhooksRepository.update({ id: job.data.webhookId }, { latestSentAt: new Date(), latestStatus: res instanceof StatusError ? res.statusCode : 1, }); - + if (res instanceof StatusError) { // 4xx if (res.isClientError) { throw new Bull.UnrecoverableError(`${res.statusCode} ${res.statusMessage}`); } - + // 5xx etc. throw new Error(`${res.statusCode} ${res.statusMessage}`); } else { |