fix: various bugs (#39661) (#39667)

Backport #39661

1. fix #39660: relax email validation
2. fix #39658: use "int64" instead of time.Duration (for JSON v2)

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
This commit is contained in:
Giteabotandwxiaoguang authored and GitHub committed 2026-10-07 10:11:58 -07:00
1 parent 4ebd5e319b
commit 27bd022b34
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)
}