Use and query for where clause.

This commit is contained in:
Kavin 2022-09-25 22:19:37 +01:00
parent b31315bbe2
commit dcc4b6e807
No known key found for this signature in database
GPG key ID: 49451E4482CC5BCD

View file

@ -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) {