Skip to content

Commit

Permalink
queuer storages jsons in files
Browse files Browse the repository at this point in the history
  • Loading branch information
vitor-costa committed Dec 4, 2014
1 parent 6e7a6f3 commit 49d8bd5
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 2 deletions.
5 changes: 3 additions & 2 deletions dataQueuer.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@ function appendDataAsync(data_to_append) {
//});
var date = new Date();
var file_name = moment(date).format("YYYYMMDDHH") + ".json";
fs.writeFile(__dirname + "/files/" + file_name, data_to_append, function(err) {
// console.log(data_to_append);
fs.writeFile(__dirname + "/files/" + file_name, "" + data_to_append, function(err) {
if(err) {
console.log(err);
} else {
Expand Down Expand Up @@ -78,6 +79,6 @@ setInterval(function() {
// Checks if data already has been generated by JSON.parse.
if(data != null) {
// var formatted_data = data_formatter();
appendDataAsync(data);
appendDataAsync(JSON.stringify(data));
}
}, intervalTime);
1 change: 1 addition & 0 deletions files/2014120410.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions files/2014120411.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions files/2014120412.json

Large diffs are not rendered by default.

0 comments on commit 49d8bd5

Please sign in to comment.