mirror of
https://github.com/simple-login/app.git
synced 2024-11-13 04:04:55 +08:00
Send limit for lifetime that fitx in u32 (#2302)
This commit is contained in:
parent
0eca359012
commit
f7b7b6d222
3 changed files with 4 additions and 4 deletions
|
@ -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
|
||||
)
|
||||
),
|
||||
)
|
||||
|
|
|
@ -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()
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue