Skip to content

Commit

Permalink
Merge branch 'master-COLLAUDO' into features-dic24/various-connectors…
Browse files Browse the repository at this point in the history
…-coll1

# Conflicts:
#	package-lock.json
#	package.json
  • Loading branch information
Giovanni Troisi committed Dec 9, 2024
2 parents 006840f + 425111e commit 28e7ae0
Show file tree
Hide file tree
Showing 20 changed files with 1,281 additions and 165 deletions.
2 changes: 1 addition & 1 deletion app.js
Original file line number Diff line number Diff line change
Expand Up @@ -553,7 +553,7 @@ app.use('/:projectid/departments', department);
channelManager.useUnderProjects(app);

app.use('/:projectid/groups', [passport.authenticate(['basic', 'jwt'], { session: false }), validtoken, roleChecker.hasRoleOrTypes('agent', ['bot','subscription'])], group);
app.use('/:projectid/tags', [passport.authenticate(['basic', 'jwt'], { session: false }), validtoken, roleChecker.hasRole('agent')], tag);
app.use('/:projectid/tags', [passport.authenticate(['basic', 'jwt'], { session: false }), validtoken, roleChecker.hasRoleOrTypes('agent', ['bot','subscription'])], tag);
app.use('/:projectid/subscriptions', [passport.authenticate(['basic', 'jwt'], { session: false }), validtoken, roleChecker.hasRole('admin')], resthook);

//deprecated
Expand Down
3 changes: 3 additions & 0 deletions jobs.js
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,9 @@ async function main()
let scheduler = require('./pubmodules/scheduler');
jobsManager.listenScheduler(scheduler);

let multiWorkerQueue = require('@tiledesk/tiledesk-multi-worker');
jobsManager.listenMultiWorker(multiWorkerQueue);


winston.info("Jobs started");

Expand Down
8 changes: 8 additions & 0 deletions jobsManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,14 @@ class JobsManager {
// this.whatsappQueue.listen(); // oppure codice
}

listenMultiWorker(multiWorkerQueue) {
console.log("JobsManager multiWorkerQueue started");
console.log("multiWorkerQueue is: ", multiWorkerQueue)
if (this.jobWorkerEnabled == true) {
return winston.info("JobsManager jobWorkerEnabled is enabled. Skipping listener for MultiWorker Queue");
}
}

// listenTrainingQueue(trainingQueue) {
// console.log("JobsManager listenTrainingQueue started");
// console.log("trainingQueue is: ", trainingQueue)
Expand Down
29 changes: 29 additions & 0 deletions models/analytics.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
var mongoose = require('mongoose');
var Schema = mongoose.Schema;

var AnalyticsSchema = new Schema({
id_project: {
type: String,
required: true,
},
type: {
type: String,
required: true
},
date: {
type: String,
required: true
//default: () => new Date().setHours(0, 0, 0, 0)
},
keys: {
type: Object,
required: true
}
}, {
timestamps: true
})


const Analytics = mongoose.model('Analytics', AnalyticsSchema)
module.exports = Analytics

4 changes: 4 additions & 0 deletions models/transaction.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@ const TransactionSchema = mongoose.Schema({
type: String,
required: false
},
broadcast: {
type: Boolean,
required: false
},
createdAt: {
type: Date,
default: Date.now
Expand Down
Loading

0 comments on commit 28e7ae0

Please sign in to comment.