projects
/
arvados.git
/ blobdiff
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
12087: Don't report read/write errors on terminated sessions.
[arvados.git]
/
services
/
ws
/
event_source.go
diff --git
a/services/ws/event_source.go
b/services/ws/event_source.go
index 6a308b3a62df3ac14c36d51ba8b08b7a7b7694f6..cfb828b2a5d84c6d16407866374e1f4900185f84 100644
(file)
--- a/
services/ws/event_source.go
+++ b/
services/ws/event_source.go
@@
-1,3
+1,7
@@
+// Copyright (C) The Arvados Authors. All rights reserved.
+//
+// SPDX-License-Identifier: AGPL-3.0
+
package main
import (
package main
import (
@@
-239,11
+243,13
@@
func (ps *pgEventSource) NewSink() eventSink {
}
func (ps *pgEventSource) DB() *sql.DB {
}
func (ps *pgEventSource) DB() *sql.DB {
+ ps.WaitReady()
return ps.db
}
func (ps *pgEventSource) DBHealth() error {
return ps.db
}
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)
}
@@
-263,6
+269,7
@@
func (ps *pgEventSource) DebugStatus() interface{} {
"QueueDelay": stats.Duration(ps.lastQDelay),
"Sinks": len(ps.sinks),
"SinksBlocked": blocked,
"QueueDelay": stats.Duration(ps.lastQDelay),
"Sinks": len(ps.sinks),
"SinksBlocked": blocked,
+ "DBStats": ps.db.Stats(),
}
}
}
}