diff options
| author | syuilo <syuilotan@yahoo.co.jp> | 2019-02-07 23:37:39 +0900 |
|---|---|---|
| committer | syuilo <syuilotan@yahoo.co.jp> | 2019-02-07 23:37:39 +0900 |
| commit | 9d50a06d9c478e0e416c78dd0c321fd1e74277f9 (patch) | |
| tree | aa0695c5ec3c85fcb51dc2a61e1a2c2be6112b7f /src/queue | |
| parent | Remove unused import (diff) | |
| download | sharkey-9d50a06d9c478e0e416c78dd0c321fd1e74277f9.tar.gz sharkey-9d50a06d9c478e0e416c78dd0c321fd1e74277f9.tar.bz2 sharkey-9d50a06d9c478e0e416c78dd0c321fd1e74277f9.zip | |
Fix bug
Diffstat (limited to 'src/queue')
| -rw-r--r-- | src/queue/processors/http/deliver.ts | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/queue/processors/http/deliver.ts b/src/queue/processors/http/deliver.ts index cb92a4d760..82dcf06ad4 100644 --- a/src/queue/processors/http/deliver.ts +++ b/src/queue/processors/http/deliver.ts @@ -6,11 +6,13 @@ import { registerOrFetchInstanceDoc } from '../../../services/register-or-fetch- import Instance from '../../../models/instance'; export default async (job: bq.Job, done: any): Promise<void> => { + const { host } = new URL(job.data.to); + try { await request(job.data.user, job.data.to, job.data.content); // Update stats - registerOrFetchInstanceDoc(job.data.user.host).then(i => { + registerOrFetchInstanceDoc(host).then(i => { Instance.update({ _id: i._id }, { $set: { latestRequestSentAt: new Date(), @@ -22,7 +24,7 @@ export default async (job: bq.Job, done: any): Promise<void> => { done(); } catch (res) { // Update stats - registerOrFetchInstanceDoc(job.data.user.host).then(i => { + registerOrFetchInstanceDoc(host).then(i => { Instance.update({ _id: i._id }, { $set: { latestRequestSentAt: new Date(), |