Skip to content

Commit

Permalink
test fix
Browse files Browse the repository at this point in the history
  • Loading branch information
kodi committed Aug 26, 2019
1 parent cd848e9 commit ebf97eb
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
node_modules/
logs/*.log
.DS_Store
8 changes: 4 additions & 4 deletions bin/producer.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ const faker = require('faker');
const NUM_LOGS = 4;
const UPDATE_INTERVAL = 500;

let counter = 0;
let producedCounter = 0;
setInterval(() => {
let mdl = counter % NUM_LOGS;
let mdl = producedCounter % NUM_LOGS;

let number = faker.random.number();
console.log(number);
Expand All @@ -19,7 +19,7 @@ setInterval(() => {

let line = `${uuid}\t${number}\t${word}\n`;

if (counter % 5 === 0) {
if (producedCounter % 5 === 0) {
let lineNew = Math.random().toString(36).slice(-95) + '\n';
console.log(lineNew);
line = lineNew;
Expand All @@ -28,5 +28,5 @@ setInterval(() => {
fs.appendFileSync(`logs/log-${mdl}.log`, line);

console.log(`wrote : ${line}`);
counter += 1;
producedCounter += 1;
}, UPDATE_INTERVAL);

0 comments on commit ebf97eb

Please sign in to comment.