fix memory leak by freeing queries at bottom of loop
diff --git a/xos/observers/hpc/hpc_watcher.py b/xos/observers/hpc/hpc_watcher.py
index e3a316f..0821e6c 100644
--- a/xos/observers/hpc/hpc_watcher.py
+++ b/xos/observers/hpc/hpc_watcher.py
@@ -43,7 +43,7 @@
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "xos.settings")
import django
from django.contrib.contenttypes.models import ContentType
-from core.models import *
+from core.models import *
from hpc.models import *
from requestrouter.models import *
django.setup()
@@ -467,6 +467,8 @@
self.run_once()
time.sleep(10)
+ django.db.reset_queries()
+
class HpcProber(BaseWatcher):
def __init__(self):
BaseWatcher.__init__(self)
@@ -501,6 +503,8 @@
self.run_once()
time.sleep(10)
+ django.db.reset_queries()
+
class HpcFetcher(BaseWatcher):
def __init__(self):
BaseWatcher.__init__(self)
@@ -553,6 +557,8 @@
self.run_once()
time.sleep(10)
+ django.db.reset_queries()
+
class WatcherFetcher(BaseWatcher):
def __init__(self):
BaseWatcher.__init__(self)
@@ -602,6 +608,9 @@
self.run_once()
time.sleep(10)
+ django.db.reset_queries()
+
+
if __name__ == "__main__":
if "--once" in sys.argv:
RRWatcher().run_once()