Add sentry videoId information to pubsub webhook.

This commit is contained in:
Kavin 2023-06-05 23:44:05 +01:00
parent afc109f408
commit b9f8fc99f5
No known key found for this signature in database
GPG key ID: 49451E4482CC5BCD

View file

@ -10,6 +10,7 @@ import io.activej.inject.annotation.Provides;
import io.activej.inject.module.AbstractModule;
import io.activej.inject.module.Module;
import io.activej.launchers.http.MultithreadedHttpServerLauncher;
import io.sentry.Sentry;
import it.unimi.dsi.fastutil.objects.ObjectArrayList;
import me.kavin.piped.consts.Constants;
import me.kavin.piped.server.handlers.*;
@ -87,12 +88,14 @@ public class ServerLauncher extends MultithreadedHttpServerLauncher {
Multithreading.runAsync(() -> {
for (var entry : feed.getEntries()) {
String url = entry.getLinks().get(0).getHref();
String videoId = StringUtils.substring(url, -11);
try (StatelessSession s = DatabaseSessionFactory.createStatelessSession()) {
if (DatabaseHelper.doesVideoExist(s, StringUtils.substring(url, -11)))
if (DatabaseHelper.doesVideoExist(s, videoId))
continue;
}
Multithreading.runAsync(() -> {
try {
Sentry.setExtra("videoId", videoId);
StreamInfo info = StreamInfo.getInfo(url);
Multithreading.runAsync(() -> {