Skip to content

Commit 8648f80

Browse files
authored
feat: replace restart environment variable hash with unix epoch (#251)
1 parent ddb1bd6 commit 8648f80

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/posit/connect/content.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
from __future__ import annotations
44

55
import posixpath
6-
import secrets
6+
import time
77
from posixpath import dirname
88
from typing import List, Optional, overload
99

@@ -213,9 +213,9 @@ def restart(self) -> None:
213213
self.update()
214214

215215
if self.is_interactive:
216-
random_hash = secrets.token_hex(32)
217-
key = f"_CONNECT_RESTART_TMP_{random_hash}"
218-
self.environment_variables.create(key, random_hash)
216+
unix_epoch_in_seconds = str(int(time.time()))
217+
key = f"_CONNECT_RESTART_TMP_{unix_epoch_in_seconds}"
218+
self.environment_variables.create(key, unix_epoch_in_seconds)
219219
self.environment_variables.delete(key)
220220
# GET via the base Connect URL to force create a new worker thread.
221221
url = posixpath.join(dirname(self.url), f"content/{self.guid}")

0 commit comments

Comments
 (0)