PIFSCstockassessments / ageproR

Prototype R package interface for AGEPRO (Age Structure Projection Model) using the JSON data format.
GNU General Public License v3.0
1 stars 0 forks source link

aggepro_inp_model: Clean up AGEPRO Input File file Connection on.exit() #53

Closed efletcherPIFSC closed 2 months ago

efletcherPIFSC commented 2 months ago

Use R6Class finalizers to clean up file connections.

efletcherPIFSC commented 2 months ago

Placing the file connection in try-catch handler works as the same, any errors or interrupts should close file connections and revert to default values (TODO: Rollback agepro_inp_model values before erroneous file read). Only implement if ageproR produces shared data structures such as databases..