• 0
  • 0

定时器——先执行一次后定期执行

2019-09-24 31 0 admin 所属分类:Javascript
check_rider_limit() {
    var that = this;
    if (common.timer_rider_limit == 0) {
        common.timer_rider_limit = setInterval(function() {
            that.check_rider_limit();
        }, 5 * 1000);
    }
    this.rider_limit(function(res) {
        if (res.status == 1) {
            common.rider_info['max_takes'] = res.data.max_takes;
            common.rider_info['running_tasks'] = res.data.running_tasks;
        }
    });
}


返回顶部