mirror of
https://codeberg.org/prof_x_pvt_ltd/captive.whump.shanti-portal
synced 2024-08-14 22:46:42 +00:00
comparing the wrong time here
This commit is contained in:
parent
64586005a7
commit
bc0a9b851a
1 changed files with 5 additions and 1 deletions
|
@ -165,7 +165,7 @@ if args.refresh:
|
|||
|
||||
# Also do a purge of clients that have no traffic for 24 hrs
|
||||
if client.last_activity:
|
||||
time_diff = client.last_activity-client.created
|
||||
time_diff = current_date-client.last_activity
|
||||
|
||||
if client.last_packets >= int(packets_val) and time_diff.days >= 1:
|
||||
client.enabled = False
|
||||
|
@ -174,6 +174,10 @@ if args.refresh:
|
|||
ip=client.ip_address
|
||||
))
|
||||
client.commit()
|
||||
else:
|
||||
if not client.enabled:
|
||||
client.enabled = True
|
||||
client.commit()
|
||||
|
||||
for src_ip in args.src_ip:
|
||||
# Get client by IP or create a new one.
|
||||
|
|
Loading…
Reference in a new issue