Boards data retention (#19262)
* add Boards to DataRetention, add hook for data retention * remove replaces * update hook to remove parameter * add boards data retention to telemetry * fix unit test * update test, update hooks * update RunDataRetention server version * put behind a feature flag Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
294bd44971
Коммит
956e21cfa2
@@ -669,6 +669,43 @@ func (s *hooksRPCServer) WebSocketMessageHasBeenPosted(args *Z_WebSocketMessageH
|
||||
return nil
|
||||
}
|
||||
|
||||
func init() {
|
||||
hookNameToId["RunDataRetention"] = RunDataRetentionID
|
||||
}
|
||||
|
||||
type Z_RunDataRetentionArgs struct {
|
||||
A int64
|
||||
B int64
|
||||
}
|
||||
|
||||
type Z_RunDataRetentionReturns struct {
|
||||
A int64
|
||||
B error
|
||||
}
|
||||
|
||||
func (g *hooksRPCClient) RunDataRetention(nowTime, batchSize int64) (int64, error) {
|
||||
_args := &Z_RunDataRetentionArgs{nowTime, batchSize}
|
||||
_returns := &Z_RunDataRetentionReturns{}
|
||||
if g.implemented[RunDataRetentionID] {
|
||||
if err := g.client.Call("Plugin.RunDataRetention", _args, _returns); err != nil {
|
||||
g.log.Error("RPC call RunDataRetention to plugin failed.", mlog.Err(err))
|
||||
}
|
||||
}
|
||||
return _returns.A, _returns.B
|
||||
}
|
||||
|
||||
func (s *hooksRPCServer) RunDataRetention(args *Z_RunDataRetentionArgs, returns *Z_RunDataRetentionReturns) error {
|
||||
if hook, ok := s.impl.(interface {
|
||||
RunDataRetention(nowTime, batchSize int64) (int64, error)
|
||||
}); ok {
|
||||
returns.A, returns.B = hook.RunDataRetention(args.A, args.B)
|
||||
returns.B = encodableError(returns.B)
|
||||
} else {
|
||||
return encodableError(fmt.Errorf("Hook RunDataRetention called but not implemented."))
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
type Z_RegisterCommandArgs struct {
|
||||
A *model.Command
|
||||
}
|
||||
|
||||
Ссылка в новой задаче
Block a user