more flexibility for queries (strore in config file)

This commit is contained in:
Joe
2019-01-31 11:59:41 -06:00
parent d20c9c81fd
commit 97b550506a
5 changed files with 13 additions and 5 deletions

View File

@@ -39,7 +39,6 @@ logger.log("info", `DBExtractor v0.1 Starting`);
logger.log("debug", "Config" + JSON.stringify(config))
const maxResultsPerMessage=100;
let maxPKey = "";
let maxPKeyUnsent = "";
let allRows = [];
@@ -52,7 +51,7 @@ try {
logger.log("debug", "MaxPKey Loaded: " + maxPKey);
} catch (ex) {
if (ex.errno === -4058) {
logger.log("info", "MaxPKey-File not existing. Will be created.");
logger.log("info", "MaxPKey-File not existing. All data will be processed");
} else {
logger.log("error", "opening DBExtractor.maxPKey.dat :" + ex);
}
@@ -67,7 +66,7 @@ try {
sqlRequest.stream = true;
function runNextPoll(){
sqlRequest.query("select top " + maxResultsPerMessage + " * from rpslog where pkey > '" + maxPKey + "' order by pkey");
sqlRequest.query(eval(config.statements.poller));
}
runNextPoll();