Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
jamiesun committed May 24, 2024
2 parents 6b697a1 + 7a0e1ad commit e7ecd37
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 9 deletions.
12 changes: 6 additions & 6 deletions assets/buildinfo.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
BuildVersion=latest v8.0.7 2024-05-17 14:24:48
BuildVersion=latest v8.0.7 2024-05-24 12:10:02
ReleaseVersion=v8.0.7
BuildTime=2024-05-17 14:24:48
BuildTime=2024-05-24 12:10:02
BuildName=toughradius
CommitID=21a608ca5ffa2387294f22facb31d49daf9b6df3
CommitDate=Fri, 17 May 2024 13:50:28 +0800
CommitUser=noreply@github.com
CommitSubject=Bump golang.org/x/net from 0.19.0 to 0.23.0 (#169)
CommitID=53482ee74a003b63455618891e6b62e4148a3a3b
CommitDate=Fri, 17 May 2024 14:24:50 +0800
CommitUser=jamiesun.net@gmail.com
CommitSubject=2024-05-17 14:24:48 : Security Update
19 changes: 16 additions & 3 deletions toughradius/radius.go
Original file line number Diff line number Diff line change
Expand Up @@ -357,9 +357,22 @@ func (s *RadiusService) EndRadiusAccounting(online models.RadiusOnline) error {
"acct_output_packets": online.AcctOutputPackets,
"acct_session_time": online.AcctSessionTime,
}
return app.GDB().Model(&models.RadiusOnline{}).
Where("acct_session_id= ?", online.AcctSessionId).
Updates(&param).Error

result := app.GDB().Model(&models.RadiusAccounting{}).
Where("acct_session_id = ?", online.AcctSessionId).
Updates(&param)

if result.Error != nil {
// 处理错误
return result.Error
}

if result.RowsAffected == 0 {
// 没有记录被更新,记录可能不存在
return fmt.Errorf("no records found with acct_session_id = %v", online.AcctSessionId)
}

return nil
}

func (s *RadiusService) RemoveRadiusOnline(sessionId string) error {
Expand Down

0 comments on commit e7ecd37

Please sign in to comment.