Skip to content

Commit 48a235f

Browse files
committed
Pass origins to be excluded to findLogs as param
1 parent 2046bc5 commit 48a235f

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

xapi_stmt_gen/xapi_stmt_gen/generator.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3530,8 +3530,9 @@ async function translateScoTracks(tracks, userAttrs, courseNames){ // eslint-dis
35303530
/**
35313531
* Selects limited number of standard logs.
35323532
* @param {number} limit - limit value
3533+
* @param {Array.<string>} originNotIn - origins to be excluded
35333534
*/
3534-
async function findLogs(limit){
3535+
async function findLogs(limit, originNotIn = []){
35353536
const lastLogProcessed = await XAPI_RECORDS_PROCESSED.findOne({
35363537
where: {objecttable: 'logstore_standard_log'},
35373538
attributes: ['objectid'],
@@ -3548,7 +3549,7 @@ async function findLogs(limit){
35483549
[Op.gt]: lastLogProcessed ? lastLogProcessed.objectid : -1
35493550
},
35503551
origin: {
3551-
[Op.notIn]: config.filter.logstoreStandardLog.origin.exclude
3552+
[Op.notIn]: originNotIn
35523553
}
35533554
},
35543555
order: [['id', 'ASC']],
@@ -3767,8 +3768,9 @@ module.exports = async function main() { // eslint-disable-line max-statements
37673768
// Iterate logstore_standard_logs to be processed
37683769
const limit = 'limit' in config ? config.limit : 500;
37693770
const chunkSize = 'chunkSize' in config ? config.chunkSize : 100;
3771+
const originNotIn = config.filter.logstoreStandardLog.origin.exclude;
37703772
while (true){
3771-
let logs = await findLogs(limit);
3773+
let logs = await findLogs(limit, originNotIn);
37723774
if (logs.length === 0) {
37733775
logger.info(
37743776
'Finished logstore_standard_logs translation.'

0 commit comments

Comments
 (0)