@tiledesk/tiledesk-server 2.13.36 → 2.13.37
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/CHANGELOG.md +3 -0
- package/package.json +1 -1
- package/services/QuoteManager.js +0 -2
- package/services/requestService.js +10 -4
- package/utils/TdCache.js +0 -2
- package/websocket/webSocketServer.js +1 -1
package/CHANGELOG.md
CHANGED
package/package.json
CHANGED
package/services/QuoteManager.js
CHANGED
|
@@ -97,9 +97,7 @@ class QuoteManager {
|
|
|
97
97
|
}
|
|
98
98
|
|
|
99
99
|
let tokens = data.tokens * data.multiplier;
|
|
100
|
-
console.log("incr tokens by ", tokens);
|
|
101
100
|
await this.tdCache.incrbyfloat(key, tokens);
|
|
102
|
-
console.log("token increased");
|
|
103
101
|
// await this.tdCache.incrby(key, tokens);
|
|
104
102
|
this.sendEmailIfQuotaExceeded(project, data, 'tokens', key);
|
|
105
103
|
return key;
|
|
@@ -325,10 +325,16 @@ class RequestService {
|
|
|
325
325
|
})
|
|
326
326
|
}
|
|
327
327
|
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
328
|
+
/**
|
|
329
|
+
* TODO: Restore proper functioning
|
|
330
|
+
* Option commented on 03/12/2025 by Johnny in order to allows clients to receive the request populated
|
|
331
|
+
* in such case of Abandoned Request (Status 150)
|
|
332
|
+
*/
|
|
333
|
+
// if (no_populate === "true" || no_populate === true) {
|
|
334
|
+
// winston.debug("no_populate is true");
|
|
335
|
+
// requestEvent.emit('request.update', request);
|
|
336
|
+
// return resolve(request);
|
|
337
|
+
// }
|
|
332
338
|
|
|
333
339
|
return request
|
|
334
340
|
.populate('lead')
|
package/utils/TdCache.js
CHANGED
|
@@ -113,10 +113,8 @@ class TdCache {
|
|
|
113
113
|
return new Promise( async (resolve, reject) => {
|
|
114
114
|
try {
|
|
115
115
|
await this.client.incrbyfloat(key, increment);
|
|
116
|
-
console.log("incrbyfloat OK")
|
|
117
116
|
}
|
|
118
117
|
catch(error) {
|
|
119
|
-
console.error("Error on incrby: ", error);
|
|
120
118
|
reject(error);
|
|
121
119
|
}
|
|
122
120
|
return resolve();
|
|
@@ -334,7 +334,7 @@ class WebSocketServer {
|
|
|
334
334
|
|
|
335
335
|
// db.getCollection('requests').find({"id_project":"5e15bef09877c800176d217f","status":{"$lt":1000},"$or":[{"agents":{"id_user":"5ddd30bff0195f0017f72c6d"}},{"participants":"5ddd30bff0195f0017f72c6d"}]})
|
|
336
336
|
// pubblica dopo toni
|
|
337
|
-
var query = { "id_project": projectId, "status": { $lt: 1000, $gt: 50
|
|
337
|
+
var query = { "id_project": projectId, "status": { $lt: 1000, $gt: 50 }, preflight: false, "draft": { $in: [false, null] } };
|
|
338
338
|
// add hasBot:false
|
|
339
339
|
|
|
340
340
|
// var query = {"id_project":projectId, "status": { $lt: 1000, $gt: 50 }, $or:[ {preflight:false}, { preflight : { $exists: false } } ] };
|