Closed Guldoman closed 7 months ago
Should be easy enough to do; we already have flock
, so we can just store the count in a file in the bottle's folder to coordinate this.
Try f5d74c2
. Not actually sure if we should do this; if lpm crashes, this would cause ephemeral bottles to never destruct, which I'm not a huge fan of. It also adds complexity for not so many reasons, really.
Maybe we should do the new hash thing?
if lpm crashes, this would cause ephemeral bottles to never destruct
I mean, wouldn't that happen in any case?
Maybe we should do the new hash thing?
If that sounds better, sure, go for it. I'm trying to think any case where I'd actually want to run two instances of the same ephemeral bottle, but I'm not finding any good one for now.
I mean, wouldn't that happen in any case?
Yes; but the next time you ran the ephemeral bottle and closed correctly, it'd destruct. As it stands with this system, because it's incrementing a counter in a lockfile, it'd never destruct.
If that sounds better, sure, go for it. I'm trying to think any case where I'd actually want to run two instances of the same ephemeral bottle, but I'm not finding any good one for now.
I think it's better, yeah. An ephemeral bottle should be isolated, even from other instances of itself, really. That's kinda the point. I'm going to change it to this.
OK, how's that?
Seems to work fine, thanks!
So if we execute multiple times
only after closing all of the instances the bottle would be deleted.
Maybe a warning should be displayed when running multiple instances of the same ephemeral bottle.
Another possibility would be to generate a new hash if an instance is already occupying it.