mirror of
https://github.com/yusing/godoxy.git
synced 2026-04-20 15:31:24 +02:00
feat: idle sleep for proxmox LXCs
This commit is contained in:
13
internal/idlewatcher/common.go
Normal file
13
internal/idlewatcher/common.go
Normal file
@@ -0,0 +1,13 @@
|
||||
package idlewatcher
|
||||
|
||||
import "context"
|
||||
|
||||
func (w *Watcher) cancelled(reqCtx context.Context) bool {
|
||||
select {
|
||||
case <-reqCtx.Done():
|
||||
w.l.Debug().AnErr("cause", context.Cause(reqCtx)).Msg("wake canceled")
|
||||
return true
|
||||
default:
|
||||
return false
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user