Send limit for lifetime that fitx in u32 (#2302)

This commit is contained in:
Adrià Casajús 2024-11-05 14:16:57 +01:00 committed by GitHub
parent 0eca359012
commit f7b7b6d222
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 4 additions and 4 deletions

View file

@ -47,7 +47,7 @@ def lifetime_licence():
user=current_user,
content=EventContent(
user_plan_change=UserPlanChanged(
plan_end_time=arrow.get("2100-01-01").timestamp
plan_end_time=arrow.get("2038-01-01").timestamp
)
),
)

View file

@ -27,7 +27,7 @@ if max_pu_id == 0:
max_pu_id = Session.query(func.max(PartnerUser.id)).scalar()
print(f"Checking partner user {pu_id_start} to {max_pu_id}")
step = 100
step = 1000
done = 0
start_time = time.time()
with_lifetime = 0
@ -46,7 +46,7 @@ for batch_start in range(pu_id_start, max_pu_id, step):
if not user.lifetime:
continue
with_lifetime += 1
event = UserPlanChanged(plan_end_time=arrow.get("2100-01-01").timestamp)
event = UserPlanChanged(plan_end_time=arrow.get("2038-01-01").timestamp)
EventDispatcher.send_event(user, EventContent(user_plan_change=event))
Session.flush()
Session.commit()

View file

@ -45,7 +45,7 @@ for batch_start in range(pu_id_start, max_pu_id, step):
end_timestamp = None
if partner_user.user.lifetime:
with_lifetime += 1
end_timestamp = arrow.get("2100-01-01").timestamp
end_timestamp = arrow.get("2038-01-01").timestamp
elif subscription_end:
with_premium += 1
end_timestamp = subscription_end.timestamp