Ping MySQL every minute in an attempt to keep the connection alive.

I've tried various MySQL server settings, and some TCP settings on the webtry server, none seem to keep the connection from hanging, so this is a brute-force solution.

BUG=skia:
R=mtklein@google.com

Author: jcgregorio@google.com

Review URL: https://codereview.chromium.org/286543003

git-svn-id: http://skia.googlecode.com/svn/trunk@14720 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/experimental/webtry/webtry.go b/experimental/webtry/webtry.go
index f909b06..bf352fb 100644
--- a/experimental/webtry/webtry.go
+++ b/experimental/webtry/webtry.go
@@ -235,6 +235,17 @@
 		_, 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.