]> andersk Git - jira-zephyrbot.git/commitdiff
Workaround for mechanize memory leaks.
authorAnders Kaseorg <andersk@mit.edu>
Fri, 6 Mar 2009 22:16:02 +0000 (17:16 -0500)
committerAnders Kaseorg <andersk@mit.edu>
Fri, 6 Mar 2009 22:16:34 +0000 (17:16 -0500)
jirabot.py

index 2fee41dd45cbc2e9637005ff554d51ca8aeff4c5..28301677d62cfe5e294fcd8aa0fa738f8c7369ed 100755 (executable)
@@ -122,6 +122,8 @@ def zerror(msg):
 b = jira_init()
 zephyr.init()
 
+count = 0
+
 while True:
     time_file_new = time_file + '.' + ''.join(random.sample(string.letters, 8))
 
@@ -132,11 +134,17 @@ while True:
         time.sleep(17)
         continue
 
+    if (count >= 200):
+        b = jira_init()
+        count = 0
+    count += 1
+
     jira_login(b)
     b.open("https://jira.mit.edu/jira/sr/jira.issueviews:searchrequest-rss/temp/SearchRequest.xml?&pid=10185&updated%3Aprevious=-1w&sorter/field=updated&sorter/order=DESC&tempMax=1000")
     issues_rss = b.response().read()
     b.open("https://jira.mit.edu/jira/sr/jira.issueviews:searchrequest-comments-rss/temp/SearchRequest.xml?&pid=10185&updated%3Aprevious=-1w&sorter/field=updated&sorter/order=DESC&tempMax=1000")
     comments_rss = b.response().read()
+    b.clear_history()
 
     old_time = int(open(time_file_new).read())
     new_time = old_time
This page took 0.03067 seconds and 5 git commands to generate.