diff --git a/src/composables/backgroundJob.ts b/src/composables/backgroundJob.ts index b15e2a96..eaf67048 100644 --- a/src/composables/backgroundJob.ts +++ b/src/composables/backgroundJob.ts @@ -4,7 +4,7 @@ import { AxiosInstance } from 'axios'; const jobs = ref>({}); export function useBackgroundJob() { - function start(api: AxiosInstance, showAlert: any, jobId: string, jobType: string) { + function startBgJob(api: AxiosInstance, showAlert: any, jobId: string, jobType: string) { async function getBackgroundJobStatus(jobId: string) { try { const { data } = await api.get(`/background/${jobId}`); @@ -51,6 +51,6 @@ export function useBackgroundJob() { return { runningJobs, - start, + startBgJob, }; } diff --git a/src/stores/ftbot.ts b/src/stores/ftbot.ts index be3c55e9..b83034fc 100644 --- a/src/stores/ftbot.ts +++ b/src/stores/ftbot.ts @@ -711,6 +711,8 @@ export function createBotSubStore(botId: string, botName: string) { '/download_data', payload, ); + const { startBgJob } = useBackgroundJob(); + startBgJob(api, showAlert, data.job_id, 'download_data'); return Promise.resolve(data); } catch (error) { console.error(error);