Open allenmqcymp opened 4 years ago
I dont think the way we deal with file is safe, we should create a new one then rename it to the old one. This way this is atomic.
Great suggestion, @roidelapluie. The current implementation in master is simply broken whenever you write the second time, even ignoring race conditions, so what @allenmqcymp is proposing is a net-improvement IMO. In any case, @allenmqcymp, if you are up for it, implementing the solution @roidelapluie suggests would be even better :)
@roidelapluie @squat latest commit does just that. PTAL :)
Looks good, only needs a rebase to get rid of the conflict in go.sum
:slightly_smiling_face:
While working on reloading rule files, I noticed two errors.
The PR fixes both the issues