allura-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dill...@apache.org
Subject [allura] 01/03: [#8364] better ming orm session management
Date Wed, 09 Jun 2021 19:20:20 GMT
This is an automated email from the ASF dual-hosted git repository.

dill0wn pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/allura.git

commit e84fd844747acf616519020d76b0e74bba90309e
Author: Dave Brondsema <dbrondsema@slashdotmedia.com>
AuthorDate: Wed May 26 17:32:09 2021 -0400

    [#8364] better ming orm session management
---
 scripts/add_user_to_group.py | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/scripts/add_user_to_group.py b/scripts/add_user_to_group.py
index 8d36b37..b026dad 100644
--- a/scripts/add_user_to_group.py
+++ b/scripts/add_user_to_group.py
@@ -43,6 +43,7 @@ import logging
 
 from allura import model as M
 from allura.lib.utils import chunked_find
+from allura.model import main_orm_session
 from ming.orm import ThreadLocalORMSession
 
 
@@ -72,6 +73,8 @@ def main(options):
         )):
             for p in chunk:
                 update_project(options, user, p, replace_user=replace_user)
+                # clears User, Project, ProjectRole... so they're not taking up memory and
making flush_all() be slow
+                main_orm_session.clear()
     else:
         project = M.Project.query.get(neighborhood_id=nbhd._id,
                                       shortname=options.project)

Mime
View raw message