mirror of
https://codeberg.org/rimu/pyfedi
synced 2025-01-23 19:36:56 -08:00
daily maintenance - commit more often
This commit is contained in:
parent
dd93048e96
commit
53c8e3510f
1 changed files with 4 additions and 3 deletions
|
@ -251,8 +251,10 @@ def register(app):
|
|||
except Exception as e:
|
||||
db.session.rollback()
|
||||
current_app.logger.error(f"Error processing instance {instance.domain}: {e}")
|
||||
instance.failures += 1
|
||||
finally:
|
||||
nodeinfo.close()
|
||||
db.session.commit()
|
||||
|
||||
if instance.nodeinfo_href:
|
||||
try:
|
||||
|
@ -271,6 +273,7 @@ def register(app):
|
|||
current_app.logger.error(f"Error processing nodeinfo for {instance.domain}: {e}")
|
||||
finally:
|
||||
node.close()
|
||||
db.session.commit()
|
||||
|
||||
# Handle admin roles
|
||||
if instance.online() and (instance.software == 'lemmy' or instance.software == 'piefed'):
|
||||
|
@ -299,8 +302,6 @@ def register(app):
|
|||
finally:
|
||||
if response:
|
||||
response.close()
|
||||
|
||||
# Commit all changes at once
|
||||
db.session.commit()
|
||||
|
||||
except Exception as e:
|
||||
|
|
Loading…
Add table
Reference in a new issue