Rensselaer Center for Open Source Software

App profilig

2 files changed, 16 lines added, 6 lines removed

Changes

--- appengine/main.py 8c1c8469512122b59338feb722fef6f0fe4864a1
+++ appengine/main.py 1f166c6a267759493fb8fa2a8993b96b0b5d04d8
@@ -52,12 +52,15 @@
-  def get(self):
-    
-    TIME_MEMCACHE = 86400
-    
+  def sql_connection():
+    return cursor
+
+  def get(self):
+    
+    TIME_MEMCACHE = 86400
+    cursor = None
@@ -66,6 +69,7 @@
+      cursor = sql_connection()
@@ -83,6 +87,8 @@
+      if cursor is None:
+        cursor = sql_connection()
@@ -97,6 +103,8 @@
+      if cursor is None:
+        cursor = sql_connection()
@@ -111,6 +119,8 @@
+      if cursor is None:
+        cursor = sql_connection()
@@ -126,6 +136,8 @@
+      if cursor is None:
+        cursor = sql_connection()
@@ -181,8 +193,6 @@
-    
-    conn.close()
RPI Directory App • 58 weeks ago