update robot
This commit is contained in:
parent
d8c22d8d13
commit
82390a96b2
@ -21,11 +21,18 @@ let TrainModel = Backbone.Model.extend({
|
||||
this.update();
|
||||
},
|
||||
update: function () {
|
||||
this.getTrain();
|
||||
|
||||
const now = new Date;
|
||||
const mod = 60000 - (now.getTime() % 60000);
|
||||
const hours = now.getHours();
|
||||
|
||||
if (hours >= 6) {
|
||||
this.getTrain();
|
||||
}
|
||||
|
||||
|
||||
let trainUpdateFn = function () {
|
||||
|
||||
this.update();
|
||||
};
|
||||
setTimeout(trainUpdateFn.bind(this), mod + 10);
|
||||
|
Loading…
Reference in New Issue
Block a user