get rid of all the NOOP_CALLBACKs

This commit is contained in:
Girish Ramakrishnan
2021-09-17 09:22:46 -07:00
parent b3fe2a4b84
commit c5794b5ecd
8 changed files with 88 additions and 122 deletions
+3 -5
View File
@@ -30,10 +30,8 @@ const assert = require('assert'),
util = require('util'),
_ = require('underscore');
const NOOP_CALLBACK = function (error) { if (error) debug(error); };
// we cannot use tasks since the tasks table gets overwritten when db is imported
let gProvisionStatus = {
const gProvisionStatus = {
setup: {
active: false,
message: '',
@@ -136,7 +134,7 @@ async function activate(username, password, email, displayName, ip, auditSource)
eventlog.add(eventlog.ACTION_ACTIVATE, auditSource, {});
setImmediate(cloudron.onActivated.bind(null, {}, NOOP_CALLBACK));
setImmediate(() => safe(cloudron.onActivated({}), { debug }));
return {
userId: ownerId,
@@ -164,7 +162,7 @@ async function restoreTask(backupConfig, backupId, sysinfoConfig, options, audit
await settings.setBackupCredentials(backupConfig); // update just the credentials and not the policy and flags
await eventlog.add(eventlog.ACTION_RESTORE, auditSource, { backupId });
setImmediate(cloudron.onActivated.bind(null, options, NOOP_CALLBACK));
setImmediate(() => safe(cloudron.onActivated(options), { debug }));
} catch (error) {
gProvisionStatus.restore.errorMessage = error ? error.message : '';
}