Add depot, attendant, jetfire, optimus, ota services with kustomize overlays
This commit is contained in:
25
services/depot/handlers/mobile_del.go
Normal file
25
services/depot/handlers/mobile_del.go
Normal file
@@ -0,0 +1,25 @@
|
||||
package handlers
|
||||
|
||||
import (
|
||||
"github.com/fiskerinc/cloud-services/services/depot/services"
|
||||
|
||||
"github.com/fiskerinc/cloud-services/pkg/logger"
|
||||
"github.com/fiskerinc/cloud-services/pkg/redis"
|
||||
)
|
||||
|
||||
func MobileDel(db *services.DB, id string) error {
|
||||
client := services.RedisClientPool().GetFromPool()
|
||||
defer client.Close()
|
||||
|
||||
err := removeMobileSession(client, id)
|
||||
if err != nil {
|
||||
logger.Warn().Str("id", id).Err(err).Send()
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func removeMobileSession(client redis.Client, id string) error {
|
||||
_, err := client.Execute("SREM", redis.MobileSessionsKey(), id)
|
||||
return err
|
||||
}
|
||||
Reference in New Issue
Block a user