File tree Expand file tree Collapse file tree 1 file changed +11
-6
lines changed
platform-api/src/main/java/com/flow/platform/api/consumer Expand file tree Collapse file tree 1 file changed +11
-6
lines changed Original file line number Diff line number Diff line change @@ -53,16 +53,21 @@ public void onQueueItem(CmdCallbackQueueItem item) {
5353 try {
5454 jobService .callback (item );
5555 } catch (NotFoundException notFoundException ) {
56- // wait 1s re queue
57- try {
58- Thread .sleep (1000 );
59- } catch (Throwable throwable ) {
60- }
6156
62- jobService .enterQueue (item );
57+ // re-enqueue cmd callback if job not found since transaction problem
58+ reEnqueueJobCallback (item , 1000 );
6359
6460 } catch (Throwable throwable ) {
6561 LOGGER .traceMarker ("onQueueItem" , String .format ("exception - %s" , throwable ));
6662 }
6763 }
64+
65+ private void reEnqueueJobCallback (CmdCallbackQueueItem item , long wait ) {
66+ try {
67+ Thread .sleep (wait );
68+ } catch (Throwable ignore ) {
69+ }
70+
71+ jobService .enterQueue (item );
72+ }
6873}
You can’t perform that action at this time.
0 commit comments