mirror of
https://github.com/TeamPiped/Piped-Backend.git
synced 2024-08-14 23:51:41 +00:00
Merge pull request #379 from TeamPiped/subscriptions-update
Use and query for where clause.
This commit is contained in:
commit
e20a575b25
1 changed files with 4 additions and 2 deletions
|
@ -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) {
|
||||
|
|
Loading…
Reference in a new issue