apps have to reconfigured in main thread
they cannot be done in the task process
This commit is contained in:
+5
-3
@@ -284,7 +284,6 @@ async function changeLocation(auditSource, progressCallback) {
|
||||
|
||||
progressCallback({ percent: 90, message: 'Restarting mail server' });
|
||||
await restartIfActivated();
|
||||
await platform.onMailServerLocationChanged(auditSource);
|
||||
}
|
||||
|
||||
async function setLocation(subdomain, domain) {
|
||||
@@ -308,9 +307,12 @@ async function startChangeLocation(subdomain, domain, auditSource) {
|
||||
await setLocation(subdomain, domain);
|
||||
|
||||
const taskId = await tasks.add(tasks.TASK_CHANGE_MAIL_LOCATION, [ auditSource ]);
|
||||
tasks.startTask(taskId, {});
|
||||
await eventlog.add(eventlog.ACTION_MAIL_LOCATION, auditSource, { subdomain, domain, taskId });
|
||||
tasks.startTask(taskId, {}, async (error) => {
|
||||
if (error) return;
|
||||
await platform.onMailServerLocationChanged(auditSource);
|
||||
});
|
||||
|
||||
await eventlog.add(eventlog.ACTION_MAIL_LOCATION, auditSource, { subdomain, domain, taskId });
|
||||
return taskId;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user