Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 3 of 3 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. tests/embedded_struct_test.go

    	}
    
    	if hnPost.Author.ContentPtr != nil {
    		t.Errorf("Expected to get nil Author contentPtr but got: %v", hnPost.Author.ContentPtr)
    	}
    
    	if NewPost.Author.Birthday.UnixMilli() != hnPost.Author.Birthday.UnixMilli() {
    		t.Errorf("Expected to get Author birthday with %+v but got: %+v", NewPost.Author.Birthday, hnPost.Author.Birthday)
    	}
    
    	if hnPost.Author.BirthdayPtr != nil {
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Thu Oct 26 03:58:13 GMT 2023
    - 7.3K bytes
    - Viewed (0)
Back to top