Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 4 of 4 for UnixMilli (0.14 sec)

  1. internal/cachevalue/cache.go

    // Tf the Update function returns an error the value is forwarded as is and not cached.
    func (t *Cache[T]) Get() (T, error) {
    	v := t.valErr.Load()
    	ttl := t.ttl
    	vTime := t.lastUpdateMs.Load()
    	tNow := time.Now().UnixMilli()
    	if v != nil && tNow-vTime < ttl.Milliseconds() {
    		if v.e == nil {
    			return v.v, nil
    		}
    		if v.e != nil && t.opts.CacheError || t.opts.ReturnLastGood {
    			return v.v, v.e
    		}
    	}
    
    Go
    - Registered: Sun May 05 19:28:20 GMT 2024
    - Last Modified: Fri Mar 01 16:00:42 GMT 2024
    - 4.2K bytes
    - Viewed (0)
  2. callbacks/update.go

    						} else if field.AutoUpdateTime == schema.UnixMillisecond {
    							set = append(set, clause.Assignment{Column: clause.Column{Name: field.DBName}, Value: now.UnixMilli()})
    						} else if field.AutoUpdateTime == schema.UnixSecond {
    							set = append(set, clause.Assignment{Column: clause.Column{Name: field.DBName}, Value: now.Unix()})
    						} else {
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Mon Mar 18 05:44:55 GMT 2024
    - 9.4K bytes
    - Viewed (1)
  3. schema/field.go

    					field.ReflectValueOf(ctx, value).SetInt(data.UnixNano())
    				} else if field.AutoCreateTime == UnixMillisecond || field.AutoUpdateTime == UnixMillisecond {
    					field.ReflectValueOf(ctx, value).SetInt(data.UnixMilli())
    				} else {
    					field.ReflectValueOf(ctx, value).SetInt(data.Unix())
    				}
    			case *time.Time:
    				if data != nil {
    					if field.AutoCreateTime == UnixNanosecond || field.AutoUpdateTime == UnixNanosecond {
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Mon Apr 15 03:20:20 GMT 2024
    - 32K bytes
    - Viewed (1)
  4. callbacks/create.go

    									switch field.AutoUpdateTime {
    									case schema.UnixNanosecond:
    										assignment.Value = curTime.UnixNano()
    									case schema.UnixMillisecond:
    										assignment.Value = curTime.UnixMilli()
    									case schema.UnixSecond:
    										assignment.Value = curTime.Unix()
    									}
    
    									onConflict.DoUpdates = append(onConflict.DoUpdates, assignment)
    								} else {
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Mon Apr 08 03:29:55 GMT 2024
    - 12.5K bytes
    - Viewed (0)
Back to top