Work in progress on integration of IVIS.
Some fixes.
This commit is contained in:
parent
3a17d7fd75
commit
2aaa8f45b3
11 changed files with 188 additions and 12 deletions
|
@ -1,7 +1,37 @@
|
|||
'use strict';
|
||||
|
||||
const moment = require('moment');
|
||||
|
||||
const activityQueueLenthThreshold = 100;
|
||||
const actitivyQueue = [];
|
||||
|
||||
let processQueueIsRunning = false;
|
||||
|
||||
async function processQueue() {
|
||||
if (processQueueIsRunning) {
|
||||
return;
|
||||
}
|
||||
|
||||
processQueueIsRunning = true;
|
||||
|
||||
// XXX submit data to IVIS if configured in config
|
||||
|
||||
actitivyQueue.splice(0);
|
||||
|
||||
processQueueIsRunning = false;
|
||||
}
|
||||
|
||||
async function _logActivity(typeId, data) {
|
||||
// TODO
|
||||
actitivyQueue.push({
|
||||
typeId,
|
||||
data,
|
||||
timestamp: moment.utc().toISOString()
|
||||
});
|
||||
|
||||
if (actitivyQueue.length >= activityQueueLenthThreshold) {
|
||||
// noinspection ES6MissingAwait
|
||||
processQueue();
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue