Added read/write lock around last.yaml for entire run of process.py