Skip to content

Commit 9feca0c

Browse files
committed
refactor: processing order
1 parent 1cff3b7 commit 9feca0c

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

application/src/main/java/org/togetherjava/tjbot/features/dynamicvc/DynamicVoiceListener.java

+3-1
Original file line numberDiff line numberDiff line change
@@ -73,10 +73,10 @@ private void insertEventToQueue(GuildVoiceUpdateEvent event, String channelTopic
7373

7474
private void processEventFromQueue(String channelTopic) {
7575
AtomicBoolean processing = isEventProcessing.get(channelTopic);
76-
processing.set(false);
7776
GuildVoiceUpdateEvent event = eventQueues.get(channelTopic).poll();
7877

7978
if (event == null) {
79+
processing.set(false);
8080
return;
8181
}
8282

@@ -112,12 +112,14 @@ private void handleTopicUpdate(GuildVoiceUpdateEvent event, String channelTopic)
112112
return CompletableFuture.allOf(renameTasks.toArray(CompletableFuture[]::new));
113113
}).handle((result, exception) -> {
114114
processEventFromQueue(channelTopic);
115+
processing.set(false);
115116
return null;
116117
});
117118
return;
118119
}
119120

120121
processEventFromQueue(channelTopic);
122+
processing.set(false);
121123
}
122124

123125
private static CompletableFuture<? extends StandardGuildChannel> createVoiceChannelFromTopic(

0 commit comments

Comments
 (0)