Index: experimental/webtry/webtry.go |
diff --git a/experimental/webtry/webtry.go b/experimental/webtry/webtry.go |
index f909b0637d3a30d64f2dbd12fa154a339d9ae591..bf352fb13178b0573a4128365f8695a1ac255c19 100644 |
--- a/experimental/webtry/webtry.go |
+++ b/experimental/webtry/webtry.go |
@@ -235,6 +235,17 @@ func init() { |
_, err = db.Exec(sql) |
log.Printf("Info: status creating sqlite table for workspace try: %q\n", err) |
} |
+ |
+ // Ping the database to keep the connection fresh. |
+ go func() { |
+ c := time.Tick(1 * time.Minute) |
+ for _ = range c { |
+ if err := db.Ping(); err != nil { |
+ log.Printf("ERROR: Database failed to respond: %q\n", err) |
+ } |
+ } |
+ }() |
+ |
} |
// Titlebar is used in titlebar template expansion. |