mirror of
https://github.com/Sheldan/Sissi.git
synced 2026-01-03 08:19:46 +00:00
Compare commits
4 Commits
sissi-1.3.
...
sissi-1.3.
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
52c3c5bcc8 | ||
|
|
a3c1b0537e | ||
|
|
127ff821d1 | ||
|
|
7e3b23aec0 |
@@ -3,7 +3,7 @@
|
||||
<parent>
|
||||
<groupId>dev.sheldan.sissi.application</groupId>
|
||||
<artifactId>application</artifactId>
|
||||
<version>1.3.13</version>
|
||||
<version>1.3.14</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<artifactId>executable</artifactId>
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<parent>
|
||||
<groupId>dev.sheldan.sissi</groupId>
|
||||
<artifactId>sissi</artifactId>
|
||||
<version>1.3.13</version>
|
||||
<version>1.3.14</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<parent>
|
||||
<groupId>dev.sheldan.sissi.application.module.custom</groupId>
|
||||
<artifactId>sissi-customizations</artifactId>
|
||||
<version>1.3.13</version>
|
||||
<version>1.3.14</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<parent>
|
||||
<artifactId>application</artifactId>
|
||||
<groupId>dev.sheldan.sissi.application</groupId>
|
||||
<version>1.3.13</version>
|
||||
<version>1.3.14</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<parent>
|
||||
<groupId>dev.sheldan.sissi.application</groupId>
|
||||
<artifactId>sissi-modules</artifactId>
|
||||
<version>1.3.13</version>
|
||||
<version>1.3.14</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
|
||||
@@ -11,6 +11,7 @@ import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
import java.util.concurrent.CompletableFuture;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
import static dev.sheldan.sissi.module.debra.config.DebraFeatureConfig.DEBRA_DONATION_NOTIFICATION_DELAY_CONFIG_KEY;
|
||||
@@ -40,23 +41,25 @@ public class WebsocketListener extends WebSocketListener implements AsyncStartup
|
||||
|
||||
@Override
|
||||
public void onMessage(WebSocket webSocket, String text) {
|
||||
log.info("Handling received message on websocket.");
|
||||
try {
|
||||
Long targetServerId = Long.parseLong(System.getenv(DEBRA_DONATION_NOTIFICATION_SERVER_ID_ENV_NAME));
|
||||
Long delayMillis = configService.getLongValueOrConfigDefault(DEBRA_DONATION_NOTIFICATION_DELAY_CONFIG_KEY, targetServerId);
|
||||
log.info("Waiting {} milli seconds to send notification.", delayMillis);
|
||||
Thread.sleep(delayMillis);
|
||||
log.info("Loading new donation amount and sending notification.");
|
||||
Donation donation = donationService.parseDonationFromMessage(text);
|
||||
donationService.sendDonationNotification(donation).thenAccept(unused -> {
|
||||
log.info("Successfully notified about donation.");
|
||||
}).exceptionally(throwable -> {
|
||||
log.error("Failed to notify about donation.", throwable);
|
||||
return null;
|
||||
});
|
||||
} catch (Exception exception) {
|
||||
log.error("Failed to handle websocket message.", exception);
|
||||
}
|
||||
CompletableFuture.runAsync(() -> {
|
||||
log.info("Handling received message on websocket.");
|
||||
try {
|
||||
Long targetServerId = Long.parseLong(System.getenv(DEBRA_DONATION_NOTIFICATION_SERVER_ID_ENV_NAME));
|
||||
Long delayMillis = configService.getLongValueOrConfigDefault(DEBRA_DONATION_NOTIFICATION_DELAY_CONFIG_KEY, targetServerId);
|
||||
log.info("Waiting {} milli seconds to send notification.", delayMillis);
|
||||
Thread.sleep(delayMillis);
|
||||
log.info("Loading new donation amount and sending notification.");
|
||||
Donation donation = donationService.parseDonationFromMessage(text);
|
||||
donationService.sendDonationNotification(donation).thenAccept(unused -> {
|
||||
log.info("Successfully notified about donation.");
|
||||
}).exceptionally(throwable -> {
|
||||
log.error("Failed to notify about donation.", throwable);
|
||||
return null;
|
||||
});
|
||||
} catch (Exception exception) {
|
||||
log.error("Failed to handle websocket message.", exception);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<parent>
|
||||
<groupId>dev.sheldan.sissi.application</groupId>
|
||||
<artifactId>sissi-modules</artifactId>
|
||||
<version>1.3.13</version>
|
||||
<version>1.3.14</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<parent>
|
||||
<groupId>dev.sheldan.sissi.application</groupId>
|
||||
<artifactId>application</artifactId>
|
||||
<version>1.3.13</version>
|
||||
<version>1.3.14</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<parent>
|
||||
<groupId>dev.sheldan.sissi.application</groupId>
|
||||
<artifactId>sissi-modules</artifactId>
|
||||
<version>1.3.13</version>
|
||||
<version>1.3.14</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<parent>
|
||||
<groupId>dev.sheldan.sissi</groupId>
|
||||
<artifactId>deployment</artifactId>
|
||||
<version>1.3.13</version>
|
||||
<version>1.3.14</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
|
||||
@@ -31,4 +31,4 @@ DEBRA_DONATION_NOTIFICATION_SERVER_ID=0
|
||||
PGADMIN_DEFAULT_PASSWORD=admin
|
||||
TOKEN=<INSERT TOKEN>
|
||||
YOUTUBE_API_KEY=<INSERT KEY>
|
||||
SISSI_VERSION=1.3.13
|
||||
SISSI_VERSION=1.3.14
|
||||
@@ -3,7 +3,7 @@
|
||||
<parent>
|
||||
<groupId>dev.sheldan.sissi</groupId>
|
||||
<artifactId>deployment</artifactId>
|
||||
<version>1.3.13</version>
|
||||
<version>1.3.14</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<parent>
|
||||
<groupId>dev.sheldan.sissi</groupId>
|
||||
<artifactId>sissi</artifactId>
|
||||
<version>1.3.13</version>
|
||||
<version>1.3.14</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
|
||||
4
pom.xml
4
pom.xml
@@ -13,7 +13,7 @@
|
||||
<groupId>dev.sheldan.sissi</groupId>
|
||||
<artifactId>sissi</artifactId>
|
||||
<name>Sissi</name>
|
||||
<version>1.3.13</version>
|
||||
<version>1.3.14</version>
|
||||
|
||||
<properties>
|
||||
<maven.compiler.target>1.8</maven.compiler.target>
|
||||
@@ -57,7 +57,7 @@
|
||||
<scm>
|
||||
<url>https://maven.pkg.github.com/Sheldan/Sissi</url>
|
||||
<developerConnection>scm:git:git@github.com:Sheldan/Sissi.git</developerConnection>
|
||||
<tag>sissi-1.3.13</tag>
|
||||
<tag>sissi-1.3.14</tag>
|
||||
</scm>
|
||||
|
||||
</project>
|
||||
@@ -3,7 +3,7 @@
|
||||
<parent>
|
||||
<groupId>dev.sheldan.sissi</groupId>
|
||||
<artifactId>sissi</artifactId>
|
||||
<version>1.3.13</version>
|
||||
<version>1.3.14</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<parent>
|
||||
<groupId>dev.sheldan.sissi.templates</groupId>
|
||||
<artifactId>customization-templates</artifactId>
|
||||
<version>1.3.13</version>
|
||||
<version>1.3.14</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<parent>
|
||||
<artifactId>sissi-templates</artifactId>
|
||||
<groupId>dev.sheldan.sissi.templates</groupId>
|
||||
<version>1.3.13</version>
|
||||
<version>1.3.14</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<parent>
|
||||
<artifactId>module-templates</artifactId>
|
||||
<groupId>dev.sheldan.sissi.templates</groupId>
|
||||
<version>1.3.13</version>
|
||||
<version>1.3.14</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<parent>
|
||||
<artifactId>module-templates</artifactId>
|
||||
<groupId>dev.sheldan.sissi.templates</groupId>
|
||||
<version>1.3.13</version>
|
||||
<version>1.3.14</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<parent>
|
||||
<groupId>dev.sheldan.sissi.templates</groupId>
|
||||
<artifactId>sissi-templates</artifactId>
|
||||
<version>1.3.13</version>
|
||||
<version>1.3.14</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<parent>
|
||||
<groupId>dev.sheldan.sissi.templates</groupId>
|
||||
<artifactId>module-templates</artifactId>
|
||||
<version>1.3.13</version>
|
||||
<version>1.3.14</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<parent>
|
||||
<groupId>dev.sheldan.sissi.templates</groupId>
|
||||
<artifactId>templates</artifactId>
|
||||
<version>1.3.13</version>
|
||||
<version>1.3.14</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<parent>
|
||||
<groupId>dev.sheldan.sissi.templates</groupId>
|
||||
<artifactId>template-overrides</artifactId>
|
||||
<version>1.3.13</version>
|
||||
<version>1.3.14</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<parent>
|
||||
<groupId>dev.sheldan.sissi.templates</groupId>
|
||||
<artifactId>template-overrides</artifactId>
|
||||
<version>1.3.13</version>
|
||||
<version>1.3.14</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<parent>
|
||||
<groupId>dev.sheldan.sissi.templates</groupId>
|
||||
<artifactId>template-overrides</artifactId>
|
||||
<version>1.3.13</version>
|
||||
<version>1.3.14</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<parent>
|
||||
<artifactId>sissi-templates</artifactId>
|
||||
<groupId>dev.sheldan.sissi.templates</groupId>
|
||||
<version>1.3.13</version>
|
||||
<version>1.3.14</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<parent>
|
||||
<groupId>dev.sheldan.sissi.templates.translations</groupId>
|
||||
<artifactId>customization-translations</artifactId>
|
||||
<version>1.3.13</version>
|
||||
<version>1.3.14</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<parent>
|
||||
<artifactId>sissi-translations</artifactId>
|
||||
<groupId>dev.sheldan.sissi.templates.translations</groupId>
|
||||
<version>1.3.13</version>
|
||||
<version>1.3.14</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<parent>
|
||||
<artifactId>module-translations</artifactId>
|
||||
<groupId>dev.sheldan.sissi.templates.translations</groupId>
|
||||
<version>1.3.13</version>
|
||||
<version>1.3.14</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<parent>
|
||||
<groupId>dev.sheldan.sissi.templates.translations</groupId>
|
||||
<artifactId>module-translations</artifactId>
|
||||
<version>1.3.13</version>
|
||||
<version>1.3.14</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<parent>
|
||||
<groupId>dev.sheldan.sissi.templates.translations</groupId>
|
||||
<artifactId>sissi-translations</artifactId>
|
||||
<version>1.3.13</version>
|
||||
<version>1.3.14</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<parent>
|
||||
<groupId>dev.sheldan.sissi.templates.translations</groupId>
|
||||
<artifactId>module-translations</artifactId>
|
||||
<version>1.3.13</version>
|
||||
<version>1.3.14</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<parent>
|
||||
<groupId>dev.sheldan.sissi.templates</groupId>
|
||||
<artifactId>templates</artifactId>
|
||||
<version>1.3.13</version>
|
||||
<version>1.3.14</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<parent>
|
||||
<groupId>dev.sheldan.sissi.templates.translations.overrides</groupId>
|
||||
<artifactId>translation-overrides</artifactId>
|
||||
<version>1.3.13</version>
|
||||
<version>1.3.14</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<parent>
|
||||
<groupId>dev.sheldan.sissi.templates.translations.overrides</groupId>
|
||||
<artifactId>translation-overrides</artifactId>
|
||||
<version>1.3.13</version>
|
||||
<version>1.3.14</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<parent>
|
||||
<groupId>dev.sheldan.sissi.templates.translations.overrides</groupId>
|
||||
<artifactId>translation-overrides</artifactId>
|
||||
<version>1.3.13</version>
|
||||
<version>1.3.14</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<parent>
|
||||
<groupId>dev.sheldan.sissi.templates.translations</groupId>
|
||||
<artifactId>sissi-translations</artifactId>
|
||||
<version>1.3.13</version>
|
||||
<version>1.3.14</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user