Support forking handlers using this metastore. v0.4.0
authorMahlon E. Smith <mahlon@martini.nu>
Wed, 25 Sep 2019 16:06:51 -0700
changeset 18 e18bc5021028
parent 17 29848143f305
child 19 d9922543b6f3
Support forking handlers using this metastore.
lib/thingfish/metastore/pggraph.rb
--- a/lib/thingfish/metastore/pggraph.rb	Sun Sep 01 15:38:16 2019 -0700
+++ b/lib/thingfish/metastore/pggraph.rb	Wed Sep 25 16:06:51 2019 -0700
@@ -24,7 +24,7 @@
 
 
 	# Package version
-	VERSION = '0.3.1'
+	VERSION = '0.4.0'
 
 	# Version control revision
 	REVISION = %q$Revision: 686fbfe638bd $
@@ -294,5 +294,11 @@
 		return ds
 	end
 
+
+	# Register a hook to make the database connection fork-safe.
+	Strelka.before_fork do
+		self.db&.disconnect
+	end
+
 end # class Thingfish::Metastore::PgGraph