mirror of
https://github.com/drakkan/sftpgo.git
synced 2025-12-07 23:00:55 +03:00
EventManager: add an action to rotate the log file
Signed-off-by: Nicola Murino <nicola.murino@gmail.com>
This commit is contained in:
@@ -2551,7 +2551,7 @@ func executeUserCheckAction(c *dataprovider.EventActionIDPAccountCheck, params *
|
||||
return &u, err
|
||||
}
|
||||
|
||||
func executeRuleAction(action dataprovider.BaseEventAction, params *EventParams,
|
||||
func executeRuleAction(action dataprovider.BaseEventAction, params *EventParams, //nolint:gocyclo
|
||||
conditions dataprovider.ConditionOptions,
|
||||
) error {
|
||||
var err error
|
||||
@@ -2585,6 +2585,8 @@ func executeRuleAction(action dataprovider.BaseEventAction, params *EventParams,
|
||||
err = executeUserExpirationCheckRuleAction(conditions, params)
|
||||
case dataprovider.ActionTypeUserInactivityCheck:
|
||||
err = executeUserInactivityCheckRuleAction(action.Options.UserInactivityConfig, conditions, params, time.Now())
|
||||
case dataprovider.ActionTypeRotateLogs:
|
||||
err = logger.RotateLogFile()
|
||||
default:
|
||||
err = fmt.Errorf("unsupported action type: %d", action.Type)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user