Skip to content

Commit

Permalink
fix interupt
Browse files Browse the repository at this point in the history
  • Loading branch information
firestar committed Sep 26, 2024
1 parent 5582ea9 commit 9440668
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ plugins {
}

group = 'com.nucleodb'
version = '1.18.10'
version = '1.18.11'

repositories {
mavenCentral()
Expand Down
4 changes: 3 additions & 1 deletion src/main/java/com/nucleodb/library/mqs/ConsumerHandler.java
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,9 @@ public void readFromStart(){
Thread queueThread;
while((queueThread = queueThreads.poll())!=null) {
try {
queueThread.interrupt();
synchronized (queueThread) {
queueThread.interrupt();
}
}catch (Exception e){}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,10 +113,12 @@ public void start(int queueHandlers) {

@Override
public void readFromStart() {
kafkaConsumingThread.interrupt();
try {
kafkaConsumingThread.wait();
} catch (InterruptedException e) {
synchronized (kafkaConsumingThread) {
kafkaConsumingThread.interrupt();
try {
kafkaConsumingThread.wait();
} catch (InterruptedException e) {
}
}
boolean connectionType = this.getConnectionHandler() != null;
boolean databaseType = this.getDatabase() != null;
Expand Down

0 comments on commit 9440668

Please sign in to comment.