Skip to content

Commit

Permalink
Change autostop to use public API. (#894)
Browse files Browse the repository at this point in the history
  • Loading branch information
rohinb2 authored Jun 16, 2024
1 parent 64609cb commit 8ece21a
Showing 1 changed file with 3 additions and 10 deletions.
13 changes: 3 additions & 10 deletions runhouse/servers/autostop_servlet.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,8 @@ def set_autostop(self, value=None):
autostop_lib.set_autostop(value, None, True)

def update_autostop_in_sky_config(self):
import pickle
from sky.skylet.autostop_lib import set_last_active_time_to_now

from sky.skylet import configs as sky_configs

autostop_mins = pickle.loads(
sky_configs.get_config("autostop_config")
).autostop_idle_minutes
if autostop_mins > 0 and (
self._last_register is None or self._last_register < self._last_activity
):
sky_configs.set_config("autostop_last_active_time", self._last_activity)
if self._last_register is None or self._last_register < self._last_activity:
set_last_active_time_to_now()
self._last_register = self._last_activity

0 comments on commit 8ece21a

Please sign in to comment.