Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commite345827

Browse files
authored
fix: Multiple builds using the incorrect agent token (#983)
This was an issue with our in-memory database that causednewer builds to return an outdated agent, which would thenbe rejected.A test case has been added to ensure this can't happen again!
1 parente8b3101 commite345827

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

‎coderd/database/databasefake/databasefake.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -626,7 +626,9 @@ func (q *fakeQuerier) GetWorkspaceAgentByAuthToken(_ context.Context, authToken
626626
q.mutex.RLock()
627627
deferq.mutex.RUnlock()
628628

629-
for_,agent:=rangeq.provisionerJobAgent {
629+
// The schema sorts this by created at, so we iterate the array backwards.
630+
fori:=len(q.provisionerJobAgent)-1;i>=0;i-- {
631+
agent:=q.provisionerJobAgent[i]
630632
ifagent.AuthToken.String()==authToken.String() {
631633
returnagent,nil
632634
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp