File tree 2 files changed +19
-11
lines changed
2 files changed +19
-11
lines changed Original file line number Diff line number Diff line change 31
31
:style =" selectorStyle"
32
32
:options =" selectArray"
33
33
:label =" $tr('frequency')"
34
+ @select =" handleUserInput"
34
35
/>
35
36
</KGridItem >
36
37
</KGrid >
43
44
:style =" selectorStyle"
44
45
:options =" getDays"
45
46
:label =" $tr('day')"
47
+ @select =" handleUserInput"
46
48
/>
47
49
</KGridItem >
48
50
</KGrid >
55
57
:style =" selectorStyle"
56
58
:options =" SyncTime"
57
59
:label =" $tr('time')"
60
+ @select =" handleUserInput"
58
61
/>
59
62
</KGridItem >
60
63
</KGrid >
78
81
<KCheckbox
79
82
:checked =" retryFlag"
80
83
:disabled =" currentTaskRunning"
81
- @change =" retryFlag = !retryFlag "
84
+ @change =" handleRetryCheckboxChange "
82
85
>
83
86
{{ $tr('checkboxLabel') }}
84
87
</KCheckbox >
222
225
device: null ,
223
226
now: null ,
224
227
selectedItem: {},
225
- // tasks: [],
226
228
selectedDay: {},
227
229
selectedTime: {},
230
+ userHasEdited: false ,
228
231
};
229
232
},
230
233
computed: {
321
324
},
322
325
watch: {
323
326
currentTask () {
324
- if (this .currentTask ) {
327
+ if (this .currentTask && ! this . userHasEdited ) {
325
328
const enqueueAt = new Date (Date .parse (this .currentTask .scheduled_datetime ));
326
329
const day = enqueueAt .getDay ();
327
330
const hours = enqueueAt .getHours ();
438
441
})
439
442
.catch (() => {
440
443
this .createTaskFailedSnackbar ();
441
- // if (this.currentTask) {
442
- // this.fetchSyncTasks();
443
- // }
444
444
});
445
445
},
446
-
447
446
goBack () {
448
447
this .$router .push (this .goBackRoute );
449
448
},
461
460
this .device = device;
462
461
});
463
462
},
463
+ handleUserInput () {
464
+ this .userHasEdited = true ;
465
+ },
466
+ handleRetryCheckboxChange () {
467
+ this .retryFlag = ! this .retryFlag ;
468
+ this .handleUserInput ();
469
+ },
464
470
},
465
471
$trs: {
466
472
editSyncScheduleTitle: {
Original file line number Diff line number Diff line change
1
+ import logger from 'kolibri-logging' ;
1
2
import { ref , onMounted , onUnmounted } from 'vue' ;
2
3
import { useTimeoutPoll } from '@vueuse/core' ;
3
4
import TaskResource from 'kolibri/apiResources/TaskResource' ;
4
5
5
6
const taskPollers = new Map ( ) ;
6
7
8
+ const logging = logger . getLogger ( __filename ) ;
9
+
7
10
export default function useTaskPooling ( queueName ) {
8
11
if ( ! taskPollers . has ( queueName ) ) {
9
12
const consumers = ref ( 0 ) ;
@@ -14,7 +17,7 @@ export default function useTaskPooling(queueName) {
14
17
try {
15
18
tasks . value = await TaskResource . list ( { queue : queueName } ) ;
16
19
} catch ( e ) {
17
- console . error ( e ) ;
20
+ logging . error ( 'Error while fetching tasks' , e ) ;
18
21
}
19
22
} ,
20
23
5000 ,
@@ -25,11 +28,10 @@ export default function useTaskPooling(queueName) {
25
28
}
26
29
27
30
const poller = taskPollers . get ( queueName ) ;
28
- poller . consumers . value ++ ;
29
-
30
31
31
32
onMounted ( ( ) => {
32
- if ( ! poller . isActive ) {
33
+ poller . consumers . value ++ ;
34
+ if ( ! poller . isActive . value ) {
33
35
poller . resume ( ) ;
34
36
}
35
37
} ) ;
You can’t perform that action at this time.
0 commit comments