@capriza/connector-controller
Advanced tools
Comparing version 1.0.33 to 1.0.34
var Connector = require ("./lib/connector.js").Connector; | ||
module.exports.Connector = Connector; |
@@ -46,3 +46,10 @@ /** | ||
this.memoryUsageInterval = setInterval (this.monitorMemoryUsage.bind(this), this.config.controllerConfig.monitorMemoryInterval); | ||
this.memoryUsageInterval = setInterval(this.monitorMemoryUsage.bind(this), this.config.controllerConfig.monitorMemoryInterval); | ||
if (this.config.controllerConfig.partialSyncInterval) { | ||
setInterval(() => { | ||
var logger = this.logger.child({ taskType : "partialSync" }); | ||
this._doSync({ logger, syncType : "partial" }); | ||
}, this.config.controllerConfig.partialSyncInterval); | ||
} | ||
} | ||
@@ -148,6 +155,8 @@ | ||
async _doSync({ logger }){ | ||
async _doSync({ logger, syncType }){ | ||
var sendPromise = Promise.resolve(); | ||
await this._syncData({ logger }); | ||
await this.connector.sync({ | ||
logger, | ||
syncType, | ||
send : approvals => { return sendPromise = sendPromise.then(() => this._sendApprovals(approvals, { logger })); } | ||
@@ -221,3 +230,2 @@ }); | ||
this._updateApprovalInCache(serverApproval); | ||
}); | ||
@@ -228,3 +236,2 @@ | ||
this.currSyncData = response.data; | ||
@@ -331,3 +338,2 @@ return this.currSyncData; | ||
case "sync": | ||
await this._syncData({logger: taskLogger}); | ||
await Promise.race([this._doSync({logger: taskLogger}), this._taskTimeout(taskLogger)]); | ||
@@ -334,0 +340,0 @@ break; |
@@ -175,3 +175,3 @@ var Syncher = require ("./syncher.js"); | ||
var fetchRes = this.BL.fetch({ signatureList, blLogger }, (err, approvalsChunk, hasMore) => { | ||
var fetchRes = this.BL.fetch({ signatureList, blLogger, fetchType : action.syncType }, (err, approvalsChunk, hasMore) => { | ||
if (err) return reject(err); | ||
@@ -178,0 +178,0 @@ processChunk(approvalsChunk, hasMore); |
@@ -0,0 +0,0 @@ module.exports = { |
@@ -0,0 +0,0 @@ var fs = require ('fs'); |
@@ -0,0 +0,0 @@ /** |
@@ -0,0 +0,0 @@ var fs = require('fs'); |
@@ -0,0 +0,0 @@ var fs = require('fs'); |
@@ -0,0 +0,0 @@ const fs = require("fs"); |
const fs = require("fs"); | ||
fs.writeFileSync("connector/resources/_vanilla.json", fs.readFileSync("connector/resources/config.json")); | ||
outpost.done(); |
@@ -0,0 +0,0 @@ { |
@@ -0,0 +0,0 @@ const util = require("util"); |
@@ -0,0 +0,0 @@ var {name, version} = require ("./module.json"); |
{ | ||
"name": "@capriza/connector-controller", | ||
"version": "1.0.33", | ||
"version": "1.0.34", | ||
"description": "Capriza connectors controller", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -0,0 +0,0 @@ # Capriza Connectors |
@@ -0,0 +0,0 @@ var path = require('path'); |
@@ -0,0 +0,0 @@ var chai = require('chai'); |
@@ -0,0 +0,0 @@ var fse = require ("fs-extra"); |
@@ -0,0 +0,0 @@ var validate = require('capriza-schema').validate; |
@@ -0,0 +0,0 @@ var expect = require('chai').expect; |
@@ -0,0 +0,0 @@ var should = require('chai').should(); |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
153697
27
2107