feat(GODT-2709): Remove the config status file when user is removed.

This commit is contained in:
Romain LE JEUNE
2023-06-30 14:48:42 +02:00
parent 6df5a82364
commit 234554b459
3 changed files with 16 additions and 4 deletions

View File

@ -57,11 +57,17 @@ func (user *User) SendConfigStatusSuccess() {
}
}
func (user *User) SendConfigStatusAbort() {
func (user *User) SendConfigStatusAbort(withTelemetry bool) {
if err := user.configStatus.Remove(); err != nil {
user.log.WithError(err).Error("Failed to remove config_status file.")
}
if !user.configStatus.IsPending() {
return
}
if !withTelemetry {
return
}
var builder configstatus.ConfigAbortBuilder
abort := builder.New(user.configStatus.Data)
data, err := json.Marshal(abort)