diff options
| author | syuilo <syuilotan@yahoo.co.jp> | 2019-02-08 20:56:16 +0900 |
|---|---|---|
| committer | syuilo <syuilotan@yahoo.co.jp> | 2019-02-08 20:56:16 +0900 |
| commit | 5e0eda9526d512344485a4ec642775ca04c2c1af (patch) | |
| tree | 90dd49e1a9ca318816305b8e35ff812d32b91163 /src/queue/processors/http | |
| parent | 10.83.0 (diff) | |
| download | sharkey-5e0eda9526d512344485a4ec642775ca04c2c1af.tar.gz sharkey-5e0eda9526d512344485a4ec642775ca04c2c1af.tar.bz2 sharkey-5e0eda9526d512344485a4ec642775ca04c2c1af.zip | |
Improve instances manegement
Resolve #4187
Diffstat (limited to 'src/queue/processors/http')
| -rw-r--r-- | src/queue/processors/http/deliver.ts | 7 | ||||
| -rw-r--r-- | src/queue/processors/http/process-inbox.ts | 4 |
2 files changed, 8 insertions, 3 deletions
diff --git a/src/queue/processors/http/deliver.ts b/src/queue/processors/http/deliver.ts index 6d24cd2634..1ba582a284 100644 --- a/src/queue/processors/http/deliver.ts +++ b/src/queue/processors/http/deliver.ts @@ -17,7 +17,9 @@ export default async (job: bq.Job, done: any): Promise<void> => { Instance.update({ _id: i._id }, { $set: { latestRequestSentAt: new Date(), - latestStatus: 200 + latestStatus: 200, + lastCommunicatedAt: new Date(), + isNotResponding: false } }); @@ -31,7 +33,8 @@ export default async (job: bq.Job, done: any): Promise<void> => { Instance.update({ _id: i._id }, { $set: { latestRequestSentAt: new Date(), - latestStatus: res != null && res.hasOwnProperty('statusCode') ? res.statusCode : null + latestStatus: res != null && res.hasOwnProperty('statusCode') ? res.statusCode : null, + isNotResponding: true } }); diff --git a/src/queue/processors/http/process-inbox.ts b/src/queue/processors/http/process-inbox.ts index 07d4b5ba71..43170848f9 100644 --- a/src/queue/processors/http/process-inbox.ts +++ b/src/queue/processors/http/process-inbox.ts @@ -126,7 +126,9 @@ export default async (job: bq.Job, done: any): Promise<void> => { registerOrFetchInstanceDoc(user.host).then(i => { Instance.update({ _id: i._id }, { $set: { - latestRequestReceivedAt: new Date() + latestRequestReceivedAt: new Date(), + lastCommunicatedAt: new Date(), + isNotResponding: false } }); |