fix: crap code fix and knwoledge_base (#9)

Co-authored-by: poimen <[email protected]>
This commit was merged in pull request #9.
This commit is contained in:
2026-09-08 23:51:45 +00:00
committed by rock
parent 8adfb98856
commit b5a75f26fd
12 changed files with 662 additions and 32 deletions
+16
View File
@@ -0,0 +1,16 @@
package temporal
import (
"context"
"time"
)
// ContextWithTimeout creates a context with the given timeout.
func ContextWithTimeout(timeout time.Duration) (context.Context, context.CancelFunc) {
return context.WithTimeout(context.Background(), timeout)
}
// ContextWithDefault creates a context with a default timeout of 10 seconds.
func ContextWithDefault() (context.Context, context.CancelFunc) {
return context.WithTimeout(context.Background(), 10*time.Second)
}