@tiledesk/tiledesk-server 2.4.30 → 2.4.32
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -69,7 +69,8 @@ findUnresponsiveRequests() {
|
|
|
69
69
|
// db.getCollection('requests').find({"hasBot":true, "status": { "$lt": 1000 }, "createdAt": { "$lte" :new ISODate("2020-11-28T20:15:31Z")} }).count()
|
|
70
70
|
|
|
71
71
|
|
|
72
|
-
//
|
|
72
|
+
// TODO escludi i ticket offline
|
|
73
|
+
// var query = { };
|
|
73
74
|
var query = {hasBot:true, status: { $lt: 1000 }, createdAt: { $lte :new Date(Date.now() - this.queryAfterTimeout ).toISOString()} };
|
|
74
75
|
|
|
75
76
|
if (this.queryProject) {
|
|
@@ -77,7 +78,7 @@ findUnresponsiveRequests() {
|
|
|
77
78
|
}
|
|
78
79
|
|
|
79
80
|
|
|
80
|
-
//
|
|
81
|
+
// TODO dovrei fare una query escludendo tutti gli id_project su cui è disabilitato oppure dovrei salvare un attribute in ogni singola request
|
|
81
82
|
|
|
82
83
|
winston.debug("CloseBotUnresponsiveRequestTask query",query);
|
|
83
84
|
|
|
@@ -101,15 +102,19 @@ findUnresponsiveRequests() {
|
|
|
101
102
|
winston.debug("CloseBotUnresponsiveRequestTask: found unresponsive requests ", requests);
|
|
102
103
|
|
|
103
104
|
let i = 0;
|
|
104
|
-
let delay =
|
|
105
|
+
let delay = 0;
|
|
105
106
|
// winston.info("delay" + delay);
|
|
106
107
|
|
|
107
108
|
requests.forEach(request => {
|
|
108
109
|
i++;
|
|
110
|
+
delay = 2*that.delayBeforeClosing*i;
|
|
111
|
+
winston.debug("CloseBotUnresponsiveRequestTask: delay : " + delay);
|
|
112
|
+
|
|
109
113
|
setTimeout(function(){
|
|
110
114
|
|
|
111
115
|
// TODO aggiungi uno sleep
|
|
112
|
-
winston.debug("********unresponsive request "
|
|
116
|
+
winston.debug("********unresponsive request : "+ request.first_text);
|
|
117
|
+
// winston.debug("********unresponsive request ", request);
|
|
113
118
|
|
|
114
119
|
// closeRequestByRequestId(request_id, id_project, skipStatsUpdate, notify, closed_by)
|
|
115
120
|
const closed_by = "_bot_unresponsive";
|