|
|
@@ -4,8 +4,22 @@ import com.github.microservice.components.data.mongo.queue.config.ExecQueueConfi
|
|
|
import org.springframework.context.annotation.Configuration;
|
|
|
import org.springframework.context.annotation.Import;
|
|
|
|
|
|
+import java.util.Map;
|
|
|
+
|
|
|
@Configuration
|
|
|
@Import(ExecQueueConfig.class)
|
|
|
public class QueueConfig extends ExecQueueConfig{
|
|
|
|
|
|
+ private static final Map<Integer, Long> SleepTime = Map.of(
|
|
|
+ 1, 2000L,
|
|
|
+ 2, 3000L,
|
|
|
+ 3, 5000L,
|
|
|
+ 4, 7000L,
|
|
|
+ 5, 11000L
|
|
|
+ );
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public long sleepTime(int tryIndex) {
|
|
|
+ return SleepTime.getOrDefault(tryIndex, 1000L * 60);
|
|
|
+ }
|
|
|
}
|