projects
/
arvados.git
/ blobdiff
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
14738: Replaces double with single quotes for code style.
[arvados.git]
/
services
/
ws
/
event_source.go
diff --git
a/services/ws/event_source.go
b/services/ws/event_source.go
index edeb647e4628e675be696cb68f4b61892b4cc606..309dab7a403e54cc5cb24daaf312dc1b5baa72f2 100644
(file)
--- a/
services/ws/event_source.go
+++ b/
services/ws/event_source.go
@@
-8,7
+8,6
@@
import (
"context"
"database/sql"
"strconv"
"context"
"database/sql"
"strconv"
- "strings"
"sync"
"sync/atomic"
"time"
"sync"
"sync/atomic"
"time"
@@
-17,21
+16,6
@@
import (
"github.com/lib/pq"
)
"github.com/lib/pq"
)
-type pgConfig map[string]string
-
-func (c pgConfig) ConnectionString() string {
- s := ""
- for k, v := range c {
- s += k
- s += "='"
- s += strings.Replace(
- strings.Replace(v, `\`, `\\`, -1),
- `'`, `\'`, -1)
- s += "' "
- }
- return s
-}
-
type pgEventSource struct {
DataSource string
MaxOpenConns int
type pgEventSource struct {
DataSource string
MaxOpenConns int
@@
-248,7
+232,8
@@
func (ps *pgEventSource) DB() *sql.DB {
}
func (ps *pgEventSource) DBHealth() error {
}
func (ps *pgEventSource) DBHealth() error {
- ctx, _ := context.WithDeadline(context.Background(), time.Now().Add(time.Second))
+ ctx, cancel := context.WithDeadline(context.Background(), time.Now().Add(time.Second))
+ defer cancel()
var i int
return ps.db.QueryRowContext(ctx, "SELECT 1").Scan(&i)
}
var i int
return ps.db.QueryRowContext(ctx, "SELECT 1").Scan(&i)
}
@@
-287,7
+272,7
@@
func (sink *pgEventSink) Stop() {
// Ensure this sink cannot fill up and block the
// server-side queue (which otherwise could in turn
// block our mtx.Lock() here)
// Ensure this sink cannot fill up and block the
// server-side queue (which otherwise could in turn
// block our mtx.Lock() here)
- for
_ =
range sink.channel {
+ for range sink.channel {
}
}()
sink.source.mtx.Lock()
}
}()
sink.source.mtx.Lock()