MCPcopy Create free account
hub / github.com/dolthub/doltgresql / LoadLocation

Method LoadLocation

postgres/parser/pgdate/zone_cache.go:65–79  ·  view source on GitHub ↗

LoadLocation wraps time.LoadLocation which does not perform caching internally and which requires many disk accesses to locate the named zoneinfo file.

(zone string)

Source from the content-addressed store, hash-verified

63// caching internally and which requires many disk accesses to
64// locate the named zoneinfo file.
65func (z *zoneCache) LoadLocation(zone string) (*time.Location, error) {
66 z.mu.Lock()
67 entry, ok := z.mu.named[zone]
68 z.mu.Unlock()
69
70 if !ok {
71 loc, err := time.LoadLocation(zone)
72
73 entry = &zoneCacheEntry{loc: loc, err: err}
74 z.mu.Lock()
75 z.mu.named[zone] = entry
76 z.mu.Unlock()
77 }
78 return entry.loc, entry.err
79}
80
81// FixedZone wraps time.FixedZone.
82func (z *zoneCache) FixedZone(hours, minutes, seconds int) *time.Location {

Callers 3

ExtractMethod · 0.80
convertTzToOffsetSecsFunction · 0.80
parameters_list.goFile · 0.80

Calls 2

LockMethod · 0.80
UnlockMethod · 0.80

Tested by

no test coverage detected