diff options
Diffstat (limited to 'db')
-rw-r--r-- | db/endpoint.go | 2 | ||||
-rw-r--r-- | db/session.go | 8 |
2 files changed, 1 insertions, 9 deletions
diff --git a/db/endpoint.go b/db/endpoint.go index cb59de5..d880510 100644 --- a/db/endpoint.go +++ b/db/endpoint.go @@ -2,7 +2,7 @@ package db func (p *Phlox) CreateEndpoint(name, path, address string) (Endpoint, error) { var id int - row := p.db.QueryRow("select max(endpointid) from endpoints;") + row := p.db.QueryRow("select coalesce(max(endpointid), 0) from endpoints;") err := row.Scan(&id) if err != nil { return Endpoint{}, err diff --git a/db/session.go b/db/session.go index b8365ff..8590d2f 100644 --- a/db/session.go +++ b/db/session.go @@ -73,14 +73,6 @@ func extractSession(s Scanner) (Session, error) { } -func (p *Phlox) TouchSession(session Session) error { - now := time.Now().UTC() - nowStr := now.Format(time.RFC3339) - _, err := p.db.Exec("update sessions set modified=? where sessionid=?;", nowStr, session.Id) - return err -} - - func (p *Phlox) CheckSession(session Session) (bool, error) { row := p.db.QueryRow("select * from sessions where sessionid = ?", session.Id) session, err := extractSession(row) |