added GetUser function
This commit is contained in:
parent
6df7c52e9e
commit
b665bf63a0
5 changed files with 112 additions and 6 deletions
3
store.go
3
store.go
|
|
@ -4,6 +4,7 @@ import (
|
|||
"database/sql"
|
||||
"errors"
|
||||
|
||||
"modernc.org/sqlite"
|
||||
sqlite3 "modernc.org/sqlite/lib"
|
||||
)
|
||||
|
||||
|
|
@ -42,7 +43,7 @@ func (s *SQLStore) AcquireLock(chapterID int64, dept string, repID int64) (int64
|
|||
`INSERT INTO runs (chapter_id, department, rep_user_id, status)
|
||||
VALUES (?, ?, ?, 'running')`, chapterID, dept, repID)
|
||||
if err != nil {
|
||||
var serr *sqLite.Error
|
||||
var serr *sqlite.Error
|
||||
if errors.As(err, &serr) && serr.Code() == sqlite3.SQLITE_CONSTRAINT_UNIQUE {
|
||||
return 0, ErrLocked
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue