- Sort Score
- Result 10 results
- Languages All
Results 1 - 10 of 10 for WithContext (0.08 sec)
-
internal/rest/rpc-stats.go
}, ConnectDone: func(network, addr string, err error) { if err == nil { atomic.StoreInt64(&dialEnd, time.Now().UnixNano()) } }, } return req.WithContext(httptrace.WithClientTrace(req.Context(), trace)), func() { if ds := atomic.LoadInt64(&dialStart); ds > 0 { if de := atomic.LoadInt64(&dialEnd); de == 0 { atomic.AddUint64(&globalStats.tcpDialErrs, 1)
Registered: Sun Nov 03 19:28:11 UTC 2024 - Last Modified: Tue Aug 13 18:21:34 UTC 2024 - 2.6K bytes - Viewed (0) -
internal/event/target/elasticsearch.go
resp, err := c.Ping( c.Ping.WithContext(ctx), ) if err != nil { return false, store.ErrNotConnected } xhttp.DrainBody(resp.Body) return !resp.IsError(), nil } func (c *esClientV7) entryExists(ctx context.Context, index string, key string) (bool, error) { res, err := c.Exists( index, key, c.Exists.WithContext(ctx), ) if err != nil { return false, err }
Registered: Sun Nov 03 19:28:11 UTC 2024 - Last Modified: Fri Sep 06 23:06:30 UTC 2024 - 15K bytes - Viewed (0) -
gorm.go
if config.NowFunc != nil { tx.Config.NowFunc = config.NowFunc } if config.Initialized { tx = tx.getInstance() } return tx } // WithContext change current instance db's context to ctx func (db *DB) WithContext(ctx context.Context) *DB { return db.Session(&Session{Context: ctx}) } // Debug start debug mode func (db *DB) Debug() (tx *DB) { tx = db.getInstance()
Registered: Sun Nov 03 09:35:10 UTC 2024 - Last Modified: Wed Oct 09 11:29:48 UTC 2024 - 12.1K bytes - Viewed (0) -
tests/transaction_test.go
func TestCancelTransaction(t *testing.T) { ctx := context.Background() ctx, cancelFunc := context.WithCancel(ctx) cancelFunc() user := *GetUser("cancel_transaction", Config{}) DB.Create(&user) err := DB.WithContext(ctx).Transaction(func(tx *gorm.DB) error { var result User tx.First(&result, user.ID) return nil }) if err == nil { t.Fatalf("Transaction should get error when using cancelled context") } }
Registered: Sun Nov 03 09:35:10 UTC 2024 - Last Modified: Sat Sep 14 12:58:29 UTC 2024 - 12.9K bytes - Viewed (0) -
cmd/http-tracer.go
tc := mcontext.TraceCtxt{ AmzReqID: w.Header().Get(xhttp.AmzRequestID), RequestRecorder: reqRecorder, ResponseRecorder: respRecorder, } r = r.WithContext(context.WithValue(r.Context(), mcontext.ContextTraceKey, &tc)) reqStartTime := time.Now().UTC() h.ServeHTTP(respRecorder, r) reqEndTime := time.Now().UTC()
Registered: Sun Nov 03 19:28:11 UTC 2024 - Last Modified: Tue Sep 24 17:13:00 UTC 2024 - 6K bytes - Viewed (0) -
tests/prepared_stmt_test.go
t.Fatalf("should assign PreparedStatement Manager back to database when using PrepareStmt mode") } ctx, cancel := context.WithTimeout(context.Background(), 500*time.Millisecond) defer cancel() txCtx := tx.WithContext(ctx) user := *GetUser("prepared_stmt", Config{}) txCtx.Create(&user) var result1 User if err := txCtx.Find(&result1, user.ID).Error; err != nil { t.Fatalf("no error should happen but got %v", err)
Registered: Sun Nov 03 09:35:10 UTC 2024 - Last Modified: Thu Aug 22 11:02:05 UTC 2024 - 8.5K bytes - Viewed (0) -
internal/rest/client.go
Method: method, URL: &u, Proto: "HTTP/1.1", ProtoMajor: 1, ProtoMinor: 1, Header: make(http.Header), Body: rc, Host: u.Host, } req = req.WithContext(ctx) if body != nil { switch v := body.(type) { case *bytes.Buffer: req.ContentLength = int64(v.Len()) buf := v.Bytes() req.GetBody = func() (io.ReadCloser, error) {
Registered: Sun Nov 03 19:28:11 UTC 2024 - Last Modified: Fri Jul 26 12:55:01 UTC 2024 - 14.7K bytes - Viewed (0) -
cmd/admin-router.go
handlerName := getHandlerName(f, "adminAPIHandlers") var handler http.HandlerFunc = func(w http.ResponseWriter, r *http.Request) { // Update request context with `logger.ReqInfo`. r = r.WithContext(newContext(r, w, handlerName)) defer logger.AuditLog(r.Context(), w, r, mustGetClaimsFromToken(r)) // Check if object layer is available, if not return error early. if !handlerFlags.Has(noObjLayerFlag) {
Registered: Sun Nov 03 19:28:11 UTC 2024 - Last Modified: Sat Sep 21 11:35:40 UTC 2024 - 26.2K bytes - Viewed (0) -
CHANGELOG/CHANGELOG-1.27.md
- Callers of `wait.ExponentialBackoffWithContext` now must pass a `ConditionWithContextFunc` to be consistent with the signature and avoid creating a duplicate context. If your condition does not need a context you can use the `ConditionFunc.WithContext()` helper to ignore the context, or use `ExponentialBackoff` directly. ([#115113](https://github.com/kubernetes/kubernetes/pull/115113), [@smarterclayton](https://github.com/smarterclayton))
Registered: Fri Nov 01 09:05:11 UTC 2024 - Last Modified: Wed Jul 17 07:48:22 UTC 2024 - 466.3K bytes - Viewed (0) -
CHANGELOG/CHANGELOG-1.31.md
- Cel: converting a quantity value into a quantity value failed. ([#123669](https://github.com/kubernetes/kubernetes/pull/123669), [@pohly](https://github.com/pohly)) - Client-go/tools/record.Broadcaster: Fixed automatic shutdown on WithContext cancellation. ([#124635](https://github.com/kubernetes/kubernetes/pull/124635), [@pohly](https://github.com/pohly)) - Do not remove the "batch.kubernetes.io/job-tracking" finalizer from a Pod, in a corner
Registered: Fri Nov 01 09:05:11 UTC 2024 - Last Modified: Wed Oct 23 12:18:32 UTC 2024 - 315.4K bytes - Viewed (0)