apps have to reconfigured in main thread

they cannot be done in the task process
This commit is contained in:
Girish Ramakrishnan
2023-08-21 21:30:07 +05:30
parent 61047e374c
commit 1ad94708b4
3 changed files with 10 additions and 8 deletions
+5 -3
View File
@@ -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;
}