ctrox / zeropod

pod that scales down to zero
Apache License 2.0
74 stars 6 forks source link

fix: make restore idempotent #23

Closed ctrox closed 4 months ago

ctrox commented 4 months ago

The activator used a sync.Once to ensure onAccept is only called once per restore but that lead to an invalid unlock in rare cases since we had to reset the sync.Once when checkpointing. A more robust solution is to get rid of the sync.Once, call onAccept on every accept and then let the restore function handle being called multiple times.