mirror of
https://github.com/TeamPiped/Piped-Backend
synced 2025-09-04 04:21:20 +02:00
Add null check for pubsub.
This commit is contained in:
parent
a1ed146924
commit
e03f2661b4
@ -44,15 +44,16 @@ public class Main {
|
||||
Collections.shuffle(channels);
|
||||
|
||||
for (String channelId : channels)
|
||||
Multithreading.runAsyncLimitedPubSub(() -> {
|
||||
Session sess = DatabaseSessionFactory.createSession();
|
||||
try {
|
||||
ResponseHelper.subscribePubSub(channelId, sess);
|
||||
} catch (IOException | InterruptedException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
sess.close();
|
||||
});
|
||||
if (channelId != null)
|
||||
Multithreading.runAsyncLimitedPubSub(() -> {
|
||||
Session sess = DatabaseSessionFactory.createSession();
|
||||
try {
|
||||
ResponseHelper.subscribePubSub(channelId, sess);
|
||||
} catch (IOException | InterruptedException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
sess.close();
|
||||
});
|
||||
|
||||
s.close();
|
||||
} catch (Exception e) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user