tracker.start()
raise ValueError()
tracker.stop() <== this line is never called
the lock will not be removed. Meaning the next time you run the same script, you will get an error Error: Another instance of codecarbon is already running. Turn off the other instance to be able to run this one. Exiting.
Before
If there was an error in the user's code
the lock will not be removed. Meaning the next time you run the same script, you will get an error
Error: Another instance of codecarbon is already running. Turn off the other instance to be able to run this one. Exiting.
Now
The lock is removed even if:
Ctl + C
to terminate the script