Created
June 10, 2015 08:57
-
-
Save nocubicles/ab60e45f561b6ce889cd to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Meteor.setInterval( function () { | |
| productDate = Products.findOne({isItReady: false}); | |
| var timeNow = Date(); | |
| var timeNow = timeNow.toString(); | |
| var timeCreated = productDate.startOfCountdown; | |
| var timeCreated = timeCreated.toString(); | |
| var productId = productDate._id; | |
| console.log(timeNow + "aeg praegu") | |
| console.log(timeCreated + "aeg millal loodi") | |
| if (timeCreated <= timeNow) { | |
| console.log("check") | |
| Products.update({_id: productId}, {$set: {isItReady: true}}, function(error, result) { | |
| console.log(productId) | |
| if (error){ | |
| console.log(error.reason) //check the error | |
| } else{ | |
| console.log("File with the id: " + result + " just get update") | |
| } | |
| }); | |
| } | |
| }, 5000); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment