mirror of
https://github.com/TeamPiped/Piped-Backend.git
synced 2025-01-07 18:10:30 +05:30
Merge pull request #379 from TeamPiped/subscriptions-update
Use and query for where clause.
This commit is contained in:
commit
e20a575b25
@ -1072,8 +1072,10 @@ public class ResponseHelper {
|
|||||||
var root = cu.getRoot();
|
var root = cu.getRoot();
|
||||||
cu
|
cu
|
||||||
.set(root.get("subscribedAt"), System.currentTimeMillis())
|
.set(root.get("subscribedAt"), System.currentTimeMillis())
|
||||||
.where(cb.lt(root.get("subscribedAt"), System.currentTimeMillis() - (TimeUnit.DAYS.toMillis(Constants.SUBSCRIPTIONS_EXPIRY) / 2)))
|
.where(cb.and(
|
||||||
.where(root.get("id").in(channelIds));
|
root.get("id").in(channelIds),
|
||||||
|
cb.lt(root.get("subscribedAt"), System.currentTimeMillis() - (TimeUnit.DAYS.toMillis(Constants.SUBSCRIPTIONS_EXPIRY) / 2))
|
||||||
|
));
|
||||||
s.createMutationQuery(cu).executeUpdate();
|
s.createMutationQuery(cu).executeUpdate();
|
||||||
tr.commit();
|
tr.commit();
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
|
Loading…
Reference in New Issue
Block a user