Skip to content

Commit

Permalink
[tmp] Revert "[tmp] Added more debug output"
Browse files Browse the repository at this point in the history
This reverts commit 28e48b2.
  • Loading branch information
pandafy committed Oct 25, 2023
1 parent a453975 commit bca0224
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions openwisp_radius/receivers.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,28 +102,23 @@ def close_previous_radius_accounting_sessions(instance, created, **kwargs):
return
RadiusAccounting = load_model('RadiusAccounting')
closed_sessions = []
logger.info(
f'username: {instance.username}; calling-station-id: {instance.calling_station_id}'
)
open_sessions = RadiusAccounting.objects.exclude(
unique_id=instance.unique_id
).filter(
stop_time__isnull=True,
calling_station_id=instance.calling_station_id,
username=instance.username,
)
logger.info(f'open_sessions: {open_sessions}')
for session in open_sessions:
session.stop_time = session.update_time or now()
session.terminate_cause = 'Session-Timeout'
closed_sessions.append(session)
# avoid bulk update if not necessary
if not closed_sessions:
return
res = RadiusAccounting.objects.bulk_update(
RadiusAccounting.objects.bulk_update(
closed_sessions, fields=['stop_time', 'terminate_cause']
)
logger.info(f'res: {res}')


def radius_user_group_change(sender, instance, **kwargs):
Expand Down

0 comments on commit bca0224

Please sign in to comment.