...
|
...
|
@@ -64,7 +64,7 @@ public class OrderHelpController { |
|
|
60, TimeUnit.SECONDS,
|
|
|
new ArrayBlockingQueue<>(1000), NamedThreadFactory.newThreadFactory("test"));
|
|
|
|
|
|
IntStream.range(0, 100)
|
|
|
IntStream.range(0, 10)
|
|
|
.forEach(i -> executorService.submit(() -> lockTest(key)));
|
|
|
ExecutorServiceUtils.shutdownAndAwaitTermination(executorService);
|
|
|
return new ApiResponse.ApiResponseBuilder()
|
...
|
...
|
@@ -81,7 +81,7 @@ public class OrderHelpController { |
|
|
if (redisLock.acquire(redisLockKey, value, 5, TimeUnit.SECONDS)) {
|
|
|
try {
|
|
|
log.info("lock test {}, {} i got the lock", key, value);
|
|
|
Thread.sleep(RandomUtils.nextInt(10, 50));
|
|
|
Thread.sleep(RandomUtils.nextInt(4000, 5000));
|
|
|
} catch (InterruptedException e) {
|
|
|
|
|
|
} finally {
|
...
|
...
|
|