MCPcopy Index your code
hub / github.com/coder/coder / UpdateValues

Method UpdateValues

coderd/agentapi/cached_workspace.go:37–49  ·  view source on GitHub ↗
(ws database.Workspace)

Source from the content-addressed store, hash-verified

35}
36
37func (cws *CachedWorkspaceFields) UpdateValues(ws database.Workspace) {
38 cws.lock.Lock()
39 defer cws.lock.Unlock()
40 cws.identity.ID = ws.ID
41 cws.identity.OwnerID = ws.OwnerID
42 cws.identity.OrganizationID = ws.OrganizationID
43 cws.identity.TemplateID = ws.TemplateID
44 cws.identity.Name = ws.Name
45 cws.identity.OwnerUsername = ws.OwnerUsername
46 cws.identity.TemplateName = ws.TemplateName
47 cws.identity.AutostartSchedule = ws.AutostartSchedule
48 cws.taskID = ws.TaskID
49}
50
51func (cws *CachedWorkspaceFields) TaskID() uuid.NullUUID {
52 cws.lock.RLock()

Callers 7

TestUpdateStatsFunction · 0.95
TestCacheUpdateFunction · 0.95
NewFunction · 0.80
TestCacheClearFunction · 0.80

Calls 2

LockMethod · 0.45
UnlockMethod · 0.45

Tested by 4

TestUpdateStatsFunction · 0.76
TestCacheUpdateFunction · 0.76
TestCacheClearFunction · 0.64