fix: various bugs (#39661)

1. fix #39660: relax email validation
2. fix #39658: use "int64" instead of time.Duration (for JSON v2)
This commit is contained in:
wxiaoguang authored and GitHub committed 2026-10-08 00:33:55 +08:00
1 parent 4cba1e18ed
commit 5a529ffd58
4 files changed
+36 -19

No files matched your search

+2 -2
View File
@@ -38,14 +38,14 @@ func ReloadTemplates(ctx context.Context) ResponseExtra {
// FlushOptions represents the options for the flush call
type FlushOptions struct {
Timeout time.Duration
Timeout int64
NonBlocking bool
}
// FlushQueues calls the internal flush-queues function
func FlushQueues(ctx context.Context, timeout time.Duration, nonBlocking bool) ResponseExtra {
reqURL := setting.LocalURL + "api/internal/manager/flush-queues"
req := newInternalRequestAPI(ctx, reqURL, "POST", FlushOptions{Timeout: timeout, NonBlocking: nonBlocking})
req := newInternalRequestAPI(ctx, reqURL, "POST", FlushOptions{Timeout: int64(timeout), NonBlocking: nonBlocking})
if timeout > 0 {
req.SetReadWriteTimeout(timeout + 10*time.Second)
}