Skip to content

Commit

Permalink
Added a test_environment setting
Browse files Browse the repository at this point in the history
  • Loading branch information
RagePeanut committed Oct 13, 2018
1 parent b4b77fb commit 82fc153
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
15 changes: 9 additions & 6 deletions app.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ const steem = require('steem');
const steemStream = require('steem');
const usernameChecker = require('./utils/username-checker');
const { kebabCase, trim, uniqCompact } = require('./utils/helper');
const { log_errors, request_nodes, stream_nodes } = require('./config');
const { log_errors, request_nodes, stream_nodes, test_environment} = require('./config');
const { version } = require('./package');

const postingKey = process.env.CHECKY_POSTING_KEY;
Expand All @@ -13,11 +13,14 @@ const comments = [];
// Checking every second if a comment has to be sent and sending it
let commentsInterval = setInterval(() => {
if(comments[0]) {
// Making sure that no comment is sent while processing this one
// clearInterval(commentsInterval);
const comment = comments.shift();
console.log(comment);
// sendMessage(comment[0], comment[1], comment[2], comment[3], comment[4] || {});
if(test_environment) {
console.log(comments.shift());
} else {
// Making sure that no comment is sent while processing this one
clearInterval(commentsInterval);
const comment = comments.shift();
sendMessage(comment[0], comment[1], comment[2], comment[3], comment[4] || {});
}
}
}, 1000);

Expand Down
3 changes: 2 additions & 1 deletion config.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,6 @@
"https://rpc.buildteam.io",
"https://rpc.steemviz.com",
"https://steemd.minnowsupportproject.org"
]
],
"test_environment": false
}

0 comments on commit 82fc153

Please sign in to comment.