Merge pull request #379 from TeamPiped/subscriptions-update

Use and query for where clause.
This commit is contained in:
Kavin 2022-09-25 22:22:13 +01:00 committed by GitHub
commit e20a575b25
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1072,8 +1072,10 @@ public class ResponseHelper {
var root = cu.getRoot();
cu
.set(root.get("subscribedAt"), System.currentTimeMillis())
.where(cb.lt(root.get("subscribedAt"), System.currentTimeMillis() - (TimeUnit.DAYS.toMillis(Constants.SUBSCRIPTIONS_EXPIRY) / 2)))
.where(root.get("id").in(channelIds));
.where(cb.and(
root.get("id").in(channelIds),
cb.lt(root.get("subscribedAt"), System.currentTimeMillis() - (TimeUnit.DAYS.toMillis(Constants.SUBSCRIPTIONS_EXPIRY) / 2))
));
s.createMutationQuery(cu).executeUpdate();
tr.commit();
} catch (Exception e) {