[fix] increase `restarts` correctly

BUG: The `restarts` always be 0 or 1 no matter how many times the script be restarted.