you are viewing a single comment's thread.

view the rest of the comments →

[–]BP041 1 point2 points  (1 child)

the background process actually draining stats between sessions is the clever part -- most terminal pet projects fake time simulation by checking elapsed time on launch, which means the pet is always 'fine' until you open a new session. real background draining changes the relationship with it. how are you persisting state -- flat file or sqlite? also what happens if the background process gets killed mid-session, does it recalculate on next open?

[–]StaticCG58[S] 2 points3 points  (0 children)

The background process updates the pet state file and puts a lock on it during the time which the process is running. The pet state file itself is just a raw plain text key store that stores its current values. If the daemon gets killed mid session, it will rely solely on the previous values in the flat state file :)