OSGOS_D1/custom/shop-client/services/helper.go

41 lines
600 B
Go

// OSGOS shop client
// =======================================================================================================
// Author: LLC Texnico <main@texnico.ru>
// All rights reserved
// Russia, Chelyabinsk, 2022-2024
package services
import (
"runtime/debug"
"shop-client/common"
"time"
)
var (
stop chan bool
)
func HelperService() {
stop = make(chan bool, 1)
for {
select {
case <-stop:
return
case <-time.After(time.Minute):
handleCommon()
}
}
}
func handleCommon() {
common.SaveOptions()
debug.FreeOSMemory()
}
func Stop() {
stop <- true
handleCommon()
}