##// END OF EJS Templates
fix(db-migrate): enforce gc collection to optimize memory usage
super-admin -
r5504:44ad8d20 default
parent child Browse files
Show More
@@ -35,16 +35,19 b' def downgrade(migrate_engine):'
35
35
36
36
37 def fixups(models, _SESSION):
37 def fixups(models, _SESSION):
38
38 for db_repo in _SESSION.query(models.Repository).all():
39 for db_repo in _SESSION.query(models.Repository).all():
39
40
40 config = db_repo._config
41 try:
41 config.set('extensions', 'largefiles', '')
42 config = db_repo._config
43 config.set('extensions', 'largefiles', '')
42
44
43 try:
45 scm = db_repo.scm_instance(cache=False, config=config, vcs_full_cache=False)
44 scm = db_repo.scm_instance(cache=False, config=config)
45 if scm:
46 if scm:
46 print(f'installing hook for repo: {db_repo}')
47 print(f'installing hook for repo: {db_repo}')
47 scm.install_hooks(force=True)
48 scm.install_hooks(force=True)
49 del scm # force GC
50 del config
48 except Exception as e:
51 except Exception as e:
49 print(e)
52 print(e)
50 print('continue...')
53 print('continue...')
General Comments 0
You need to be logged in to leave comments. Login now