mumuki / mumuki-domain

💡 Mumuki's domain model
GNU Affero General Public License v3.0
1 stars 0 forks source link

Add with_pg_retry #220

Closed julian-berbel closed 3 years ago

julian-berbel commented 3 years ago

:dart: Goal

Add method to ensure reconnection to db in case of failure.

:memo: Details

Need this in classroom and laboratory tasks, and this seemed as good a place as any. Really not sure where else it could go. Running given block as a transaction in order to hopefully avoid inconsistency issues that could be cause by db connection dying mid-block . This of course does not rollback in-memory changes though, so it's not a perfect solution.

:warning: Dependencies

None.

:back: Backwards compatibility

Yes.

:soon: Future work

Use this in classroom and laboratory tasks.