Skip to content
This repository has been archived by the owner on Oct 14, 2019. It is now read-only.

Commit

Permalink
Closed DB connections.
Browse files Browse the repository at this point in the history
  • Loading branch information
thecsw committed May 9, 2019
1 parent c6669ee commit 5a0d59d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
3 changes: 3 additions & 0 deletions api/firm/firm.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ func Firm() func(w http.ResponseWriter, r *http.Request) {
w.WriteHeader(http.StatusBadRequest)
return
}
defer conn.Close()
query := fmt.Sprintf(`
SELECT id, name, balance, size, execs,
tax, rank, private, last_payout
Expand Down Expand Up @@ -118,6 +119,7 @@ func FirmMembers() func(w http.ResponseWriter, r *http.Request) {
w.WriteHeader(http.StatusBadRequest)
return
}
defer conn.Close()
query := fmt.Sprintf(`
SELECT * FROM Investors WHERE firm = '%s'
LIMIT %d OFFSET %d`, firm_id, per_page, per_page*page)
Expand Down Expand Up @@ -177,6 +179,7 @@ func FirmMembersTop() func(w http.ResponseWriter, r *http.Request) {
w.WriteHeader(http.StatusBadRequest)
return
}
defer conn.Close()
query := fmt.Sprintf(`
SELECT Investors.id, Investors.name, Investors.balance,
Investors.completed, Investors.broke, Investors.badges,
Expand Down
1 change: 1 addition & 0 deletions api/firms/firms.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ func FirmsTop() func(w http.ResponseWriter, r *http.Request) {
w.WriteHeader(http.StatusBadRequest)
return
}
defer conn.Close()
query := fmt.Sprintf(`
SELECT id, name, balance, size, execs,
tax, rank, private, last_payout
Expand Down

0 comments on commit 5a0d59d

Please sign in to comment.