Immediately check for new configuration after we check for updates
This commit is contained in:
@@ -455,15 +455,9 @@ angular.module('Application').service('Client', ['$http', '$interval', 'md5', 'N
|
|||||||
Client.prototype.checkForUpdates = function (callback) {
|
Client.prototype.checkForUpdates = function (callback) {
|
||||||
var that = this;
|
var that = this;
|
||||||
|
|
||||||
if (that._refreshConfigTimer) $interval.cancel(that._refreshConfigTimer);
|
post('/api/v1/cloudron/check_for_updates', {}).success(function(data, status) {
|
||||||
that._refreshConfigTimer = null;
|
|
||||||
|
|
||||||
post('/api/v1/cloudron/check_for_updates', { }).success(function(data, status) {
|
|
||||||
if (status !== 200) return callback(new ClientError(status, data));
|
if (status !== 200) return callback(new ClientError(status, data));
|
||||||
|
that.refreshConfig(callback);
|
||||||
that._refreshConfigTimer = $interval(that.refreshConfig.bind(that), 5000, 20 /* 20 times */);
|
|
||||||
|
|
||||||
callback(null);
|
|
||||||
}).error(defaultErrorHandler(callback));
|
}).error(defaultErrorHandler(callback));
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user