- Sort Score
- Result 10 results
- Languages All
Results 151 - 160 of 1,446 for time (0.06 sec)
-
docs_src/middleware/tutorial001.py
import time from fastapi import FastAPI, Request app = FastAPI() @app.middleware("http") async def add_process_time_header(request: Request, call_next): start_time = time.perf_counter() response = await call_next(request) process_time = time.perf_counter() - start_time response.headers["X-Process-Time"] = str(process_time)
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Tue Aug 06 13:46:39 UTC 2024 - 365 bytes - Viewed (0) -
cmd/xl-storage-disk-id-check.go
// Offset checks a bit. time.Sleep(time.Duration(rng.Int63n(int64(1 * time.Second)))) dctx, dcancel := context.WithCancel(ctx) started := time.Now() go func() { timeout := time.NewTimer(globalDriveConfig.GetMaxTimeout()) select { case <-dctx.Done(): if !timeout.Stop() { <-timeout.C } case <-timeout.C: spent := time.Since(started)
Registered: Sun Nov 03 19:28:11 UTC 2024 - Last Modified: Sat Oct 26 09:56:26 UTC 2024 - 34.5K bytes - Viewed (0) -
internal/lsync/lrwmutex.go
return false default: if lm.lock(id, source, isWriteLock) { return true } time.Sleep(time.Duration(r.Float64() * float64(lockRetryInterval))) } } } // Unlock unlocks the write lock. // // It is a run-time error if lm is not locked on entry to Unlock. func (lm *LRWMutex) Unlock() { isWriteLock := true success := lm.unlock(isWriteLock)
Registered: Sun Nov 03 19:28:11 UTC 2024 - Last Modified: Sun Jan 02 17:15:06 UTC 2022 - 4.8K bytes - Viewed (0) -
tests/customize_field_test.go
package tests_test import ( "testing" "time" "gorm.io/gorm" . "gorm.io/gorm/utils/tests" ) func TestCustomizeColumn(t *testing.T) { type CustomizeColumn struct { ID int64 `gorm:"column:mapped_id; primary_key:yes"` Name string `gorm:"column:mapped_name"` Date *time.Time `gorm:"column:mapped_time"` } DB.Migrator().DropTable(&CustomizeColumn{}) DB.AutoMigrate(&CustomizeColumn{})
Registered: Sun Nov 03 09:35:10 UTC 2024 - Last Modified: Fri Sep 11 09:33:31 UTC 2020 - 6.9K bytes - Viewed (0) -
cmd/bucket-stats.go
avg := rl.UploadHistogram.GetAvgData() for k, v := range avg { // Convert nanoseconds to milliseconds ret[sizeTagToString(k)] = uint64(v.avg() / time.Millisecond) } return } // Update replication upload latency with a new value func (rl *ReplicationLatency) update(size int64, duration time.Duration) { rl.UploadHistogram.Add(size, duration) } // ReplicationLastMinute has last minute replication counters
Registered: Sun Nov 03 19:28:11 UTC 2024 - Last Modified: Thu Sep 12 11:39:51 UTC 2024 - 13.4K bytes - Viewed (0) -
internal/grid/grid.go
// No need to read more... return b, nil } } } // getDeadline will truncate the deadline so it is at least 1ms and at most MaxDeadline. func getDeadline(d time.Duration) time.Duration { if d < time.Millisecond { return 0 } if d > MaxDeadline { return MaxDeadline } return d } type writerWrapper struct { ch chan<- []byte ctx context.Context }
Registered: Sun Nov 03 19:28:11 UTC 2024 - Last Modified: Mon Jul 29 18:10:04 UTC 2024 - 6.9K bytes - Viewed (0) -
cmd/update-notifier.go
// difference between newer and current release. t := time.Time{} newerThan := humanize.RelTime(t, t.Add(older), "before the latest release", "") if globalServerCtxt.JSON { return fmt.Sprintf("You are running an older version of MinIO released %s, update: %s", newerThan, downloadURL) } // Return the nicely colored and formatted update message.
Registered: Sun Nov 03 19:28:11 UTC 2024 - Last Modified: Sat Mar 09 03:07:08 UTC 2024 - 3.6K bytes - Viewed (0) -
cmd/site-replication-utils.go
r := rand.New(rand.NewSource(time.Now().UnixNano())) // Run the site resync metrics load in a loop for { if err := sm.load(ctx, newObjectLayerFn()); err == nil { <-ctx.Done() return } duration := time.Duration(r.Float64() * float64(time.Second*10)) if duration < time.Second { // Make sure to sleep at least a second to avoid high CPU ticks. duration = time.Second } time.Sleep(duration) }
Registered: Sun Nov 03 19:28:11 UTC 2024 - Last Modified: Thu Jan 18 07:03:17 UTC 2024 - 8.9K bytes - Viewed (0) -
internal/dsync/dsync-server_test.go
if d := atomic.LoadInt64(&l.responseDelay); d != 0 { time.Sleep(time.Duration(d)) } l.mutex.Lock() defer l.mutex.Unlock() reply = !l.lockNotFound return reply, nil } func (l *lockServer) ForceUnlock(args *LockArgs) (reply bool, err error) { if d := atomic.LoadInt64(&l.responseDelay); d != 0 { time.Sleep(time.Duration(d)) } l.mutex.Lock() defer l.mutex.Unlock()
Registered: Sun Nov 03 19:28:11 UTC 2024 - Last Modified: Mon Jan 23 16:46:37 UTC 2023 - 8.3K bytes - Viewed (0) -
internal/config/heal/heal.go
// maximum sleep duration between objects to slow down heal operation. Sleep time.Duration `json:"sleep"` IOCount int `json:"iocount"` DriveWorkers int `json:"drive_workers"` // Cached value from Bitrot field cache struct { // -1: bitrot enabled, 0: bitrot disabled, > 0: bitrot cycle bitrotCycle time.Duration } } // BitrotScanCycle returns the configured cycle for the scanner healing
Registered: Sun Nov 03 19:28:11 UTC 2024 - Last Modified: Fri May 24 23:05:23 UTC 2024 - 4.9K bytes - Viewed (0)