summaryrefslogtreecommitdiff
path: root/src/queue/processors
diff options
context:
space:
mode:
authorsyuilo <syuilotan@yahoo.co.jp>2019-02-08 20:56:16 +0900
committersyuilo <syuilotan@yahoo.co.jp>2019-02-08 20:56:16 +0900
commit5e0eda9526d512344485a4ec642775ca04c2c1af (patch)
tree90dd49e1a9ca318816305b8e35ff812d32b91163 /src/queue/processors
parent10.83.0 (diff)
downloadsharkey-5e0eda9526d512344485a4ec642775ca04c2c1af.tar.gz
sharkey-5e0eda9526d512344485a4ec642775ca04c2c1af.tar.bz2
sharkey-5e0eda9526d512344485a4ec642775ca04c2c1af.zip
Improve instances manegement
Resolve #4187
Diffstat (limited to 'src/queue/processors')
-rw-r--r--src/queue/processors/http/deliver.ts7
-rw-r--r--src/queue/processors/http/process-inbox.ts4
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
}
});