mirror of
https://github.com/TeamPiped/Piped-Backend.git
synced 2024-08-14 23:51:41 +00:00
Merge pull request #582 from TeamPiped/fix-missing-transaction
Fix missing transaction when trying to insert new videos in a playlist
This commit is contained in:
commit
8614e6a0d8
1 changed files with 9 additions and 1 deletions
|
@ -255,7 +255,15 @@ public class AuthPlaylistHandlers {
|
|||
|
||||
video = new PlaylistVideo(videoId, info.getName(), info.getThumbnailUrl(), info.getDuration(), channel);
|
||||
|
||||
s.persist(video);
|
||||
var tr = s.beginTransaction();
|
||||
try {
|
||||
s.persist(video);
|
||||
tr.commit();
|
||||
} catch (Exception e) {
|
||||
tr.rollback();
|
||||
ExceptionHandler.handle(e);
|
||||
continue;
|
||||
}
|
||||
} catch (Exception e) {
|
||||
ExceptionHandler.handle(e);
|
||||
continue;
|
||||
|
|
Loading…
Reference in a new issue