diff --git a/src/apptask.js b/src/apptask.js index 82ab8b45a..7681ec813 100644 --- a/src/apptask.js +++ b/src/apptask.js @@ -265,7 +265,7 @@ function cleanupLogs(app, callback) { // note that redis container logs are cleaned up by the addon rimraf(path.join(paths.LOG_DIR, app.id), function (error) { - if (error) debugApp(app, 'cannot cleanup logs: %s', error); + if (error) debugApp(app, 'cannot cleanup logs:', error); callback(null); }); @@ -291,9 +291,9 @@ function downloadIcon(app, callback) { // nothing to download if we dont have an appStoreId if (!app.appStoreId) return callback(null); - debugApp(app, 'Downloading icon of %s@%s', app.appStoreId, app.manifest.version); + debugApp(app, `Downloading icon of ${app.appStoreId}@${app.manifest.version}`); - var iconUrl = settings.apiServerOrigin() + '/api/v1/apps/' + app.appStoreId + '/versions/' + app.manifest.version + '/icon'; + const iconUrl = settings.apiServerOrigin() + '/api/v1/apps/' + app.appStoreId + '/versions/' + app.manifest.version + '/icon'; async.retry({ times: 10, interval: 5000 }, function (retryCallback) { superagent @@ -498,7 +498,7 @@ function install(app, args, progressCallback, callback) { updateApp.bind(null, app, { installationState: apps.ISTATE_INSTALLED, error: null, health: null }) ], function seriesDone(error) { if (error) { - debugApp(app, 'error installing app: %s', error); + debugApp(app, 'error installing app:', error); return updateApp(app, { installationState: apps.ISTATE_ERROR, error: makeTaskError(error, app) }, callback.bind(null, error)); } callback(null); @@ -521,7 +521,7 @@ function backup(app, args, progressCallback, callback) { updateApp.bind(null, app, { installationState: apps.ISTATE_INSTALLED, error: null }) ], function seriesDone(error) { if (error) { - debugApp(app, 'error backing up app: %s', error); + debugApp(app, 'error backing up app:', error); // return to installed state intentionally. the error is stashed only in the task and not the app (the UI shows error state otherwise) return updateApp(app, { installationState: apps.ISTATE_INSTALLED, error: null }, callback.bind(null, makeTaskError(error, app))); } @@ -552,7 +552,7 @@ function create(app, args, progressCallback, callback) { updateApp.bind(null, app, { installationState: apps.ISTATE_INSTALLED, error: null, health: null }) ], function seriesDone(error) { if (error) { - debugApp(app, 'error creating : %s', error); + debugApp(app, 'error creating :', error); return updateApp(app, { installationState: apps.ISTATE_ERROR, error: makeTaskError(error, app) }, callback.bind(null, error)); } callback(null); @@ -626,7 +626,7 @@ function changeLocation(app, args, progressCallback, callback) { updateApp.bind(null, app, { installationState: apps.ISTATE_INSTALLED, error: null, health: null }) ], function seriesDone(error) { if (error) { - debugApp(app, 'error changing location : %s', error); + debugApp(app, 'error changing location:', error); return updateApp(app, { installationState: apps.ISTATE_ERROR, error: makeTaskError(error, app) }, callback.bind(null, error)); } callback(null); @@ -665,7 +665,7 @@ function migrateDataDir(app, args, progressCallback, callback) { updateApp.bind(null, app, { installationState: apps.ISTATE_INSTALLED, error: null, health: null, dataDir: newDataDir }) ], function seriesDone(error) { if (error) { - debugApp(app, 'error migrating data dir : %s', error); + debugApp(app, 'error migrating data dir:', error); return updateApp(app, { installationState: apps.ISTATE_ERROR, error: makeTaskError(error, app) }, callback.bind(null, error)); } @@ -710,7 +710,7 @@ function configure(app, args, progressCallback, callback) { updateApp.bind(null, app, { installationState: apps.ISTATE_INSTALLED, error: null, health: null }) ], function seriesDone(error) { if (error) { - debugApp(app, 'error reconfiguring : %s', error); + debugApp(app, 'error reconfiguring:', error); return updateApp(app, { installationState: apps.ISTATE_ERROR, error: makeTaskError(error, app) }, callback.bind(null, error)); } @@ -821,7 +821,7 @@ function update(app, args, progressCallback, callback) { debugApp(app, 'update aborted because backup failed', error); updateApp(app, { installationState: apps.ISTATE_INSTALLED, error: null, health: null }, callback.bind(null, error)); } else if (error) { - debugApp(app, 'Error updating app: %s', error); + debugApp(app, 'Error updating app:', error); updateApp(app, { installationState: apps.ISTATE_ERROR, error: makeTaskError(error, app) }, callback.bind(null, error)); } else { callback(null); @@ -853,7 +853,7 @@ function start(app, args, progressCallback, callback) { updateApp.bind(null, app, { installationState: apps.ISTATE_INSTALLED, error: null, health: null }) ], function seriesDone(error) { if (error) { - debugApp(app, 'error starting app: %s', error); + debugApp(app, 'error starting app:', error); return updateApp(app, { installationState: apps.ISTATE_ERROR, error: makeTaskError(error, app) }, callback.bind(null, error)); } callback(null); @@ -880,7 +880,7 @@ function stop(app, args, progressCallback, callback) { updateApp.bind(null, app, { installationState: apps.ISTATE_INSTALLED, error: null, health: null }) ], function seriesDone(error) { if (error) { - debugApp(app, 'error starting app: %s', error); + debugApp(app, 'error starting app:', error); return updateApp(app, { installationState: apps.ISTATE_ERROR, error: makeTaskError(error, app) }, callback.bind(null, error)); } callback(null); @@ -901,7 +901,7 @@ function restart(app, args, progressCallback, callback) { updateApp.bind(null, app, { installationState: apps.ISTATE_INSTALLED, error: null, health: null }) ], function seriesDone(error) { if (error) { - debugApp(app, 'error starting app: %s', error); + debugApp(app, 'error starting app:', error); return updateApp(app, { installationState: apps.ISTATE_ERROR, error: makeTaskError(error, app) }, callback.bind(null, error)); } callback(null); @@ -940,7 +940,7 @@ function uninstall(app, args, progressCallback, callback) { appdb.del.bind(null, app.id) ], function seriesDone(error) { if (error) { - debugApp(app, 'error uninstalling app: %s', error); + debugApp(app, 'error uninstalling app:', error); return updateApp(app, { installationState: apps.ISTATE_ERROR, error: makeTaskError(error, app) }, callback.bind(null, error)); } callback(null); @@ -957,7 +957,7 @@ function run(appId, args, progressCallback, callback) { apps.get(appId, function (error, app) { if (error) return callback(error); - debugApp(app, 'startTask installationState: %s runState: %s', app.installationState, app.runState); + debugApp(app, `startTask installationState: ${app.installationState} runState: ${app.runState}`); switch (app.installationState) { case apps.ISTATE_PENDING_INSTALL: diff --git a/src/services.js b/src/services.js index 7940c01c3..b7a6da06e 100644 --- a/src/services.js +++ b/src/services.js @@ -1993,7 +1993,7 @@ function teardownRedis(app, options, callback) { if (error) return callback(new BoxError(BoxError.FS_ERROR, `Error removing redis data: ${error.message}`)); rimraf(path.join(paths.LOG_DIR, `redis-${app.id}`), function (error) { - if (error) debugApp(app, 'cannot cleanup logs: %s', error); + if (error) debugApp(app, 'cannot cleanup logs:', error); appdb.unsetAddonConfig(app.id, 'redis', callback); });