code refactor

This commit is contained in:
MaysWind
2024-08-19 00:31:32 +08:00
parent 6fcb0a2b3c
commit e86d4e05ce
73 changed files with 1404 additions and 1344 deletions
+22
View File
@@ -0,0 +1,22 @@
package core
import "context"
const nullContextId = "00000000-0000-0000-0000-00000000"
// NullContext represents the null context
type NullContext struct {
context.Context
}
// GetContextId returns the current context id
func (c *NullContext) GetContextId() string {
return nullContextId
}
// NewCronJobContext returns a new null context
func NewNullContext() *NullContext {
return &NullContext{
Context: context.Background(),
}
}