mirror of
https://github.com/freqtrade/frequi.git
synced 2024-11-24 03:55:15 +00:00
Improved wording for Background Job tracking
This commit is contained in:
parent
377d038dc2
commit
8038b0efd4
|
@ -4,7 +4,7 @@ import { AxiosInstance } from 'axios';
|
||||||
const jobs = ref<Record<string, { jobType: string; status: string }>>({});
|
const jobs = ref<Record<string, { jobType: string; status: string }>>({});
|
||||||
|
|
||||||
export function useBackgroundJob() {
|
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) {
|
async function getBackgroundJobStatus(jobId: string) {
|
||||||
try {
|
try {
|
||||||
const { data } = await api.get<BackgroundTaskStatus>(`/background/${jobId}`);
|
const { data } = await api.get<BackgroundTaskStatus>(`/background/${jobId}`);
|
||||||
|
@ -51,6 +51,6 @@ export function useBackgroundJob() {
|
||||||
|
|
||||||
return {
|
return {
|
||||||
runningJobs,
|
runningJobs,
|
||||||
start,
|
startBgJob,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -711,6 +711,8 @@ export function createBotSubStore(botId: string, botName: string) {
|
||||||
'/download_data',
|
'/download_data',
|
||||||
payload,
|
payload,
|
||||||
);
|
);
|
||||||
|
const { startBgJob } = useBackgroundJob();
|
||||||
|
startBgJob(api, showAlert, data.job_id, 'download_data');
|
||||||
return Promise.resolve(data);
|
return Promise.resolve(data);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error(error);
|
console.error(error);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user