fix: log device flow entities GC result if no auth entities collected

Signed-off-by: m.nabokikh <maksim.nabokikh@flant.com>
This commit is contained in:
m.nabokikh
2021-01-11 12:33:10 +04:00
parent e3383564b9
commit 30c3d78365
2 changed files with 10 additions and 2 deletions

View File

@@ -55,6 +55,14 @@ type GCResult struct {
DeviceTokens int64
}
// IsEmpty returns whether the garbage collection result is empty or not.
func (g *GCResult) IsEmpty() bool {
return g.AuthRequests == 0 &&
g.AuthCodes == 0 &&
g.DeviceRequests == 0 &&
g.DeviceTokens == 0
}
// Storage is the storage interface used by the server. Implementations are
// required to be able to perform atomic compare-and-swap updates and either
// support timezones or standardize on UTC.