Notice
Recent Posts
Recent Comments
Link
«   2024/05   »
1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 31
Tags
more
Archives
Today
Total
관리 메뉴

그냥 저냥

코랩 런타임 유지하는 방법 본문

TIP

코랩 런타임 유지하는 방법

요다다 2023. 8. 23. 03:07

90분간 움직임이 없으면, 런타임이 종료된다.

개발자 도구창(F12)을 열어 console창에 아래와 같이 쳐주자

function ClickConnect()
{
console.log("Working");
document.querySelector("colab-connect-button").shadowRoot.getElementById('connect').click();
}
setInterval(ClickConnect,1800000);

위 코드가 더 잘 작동하는 듯. 아래 코드는 안 먹는 것 같기도

function ClickConnect() {
  var toolbarButton = document.querySelector("colab-toolbar-button");
  if (toolbarButton) {
    toolbarButton.click();
    console.log("Working Ok");
  } else {
    console.log("colab-toolbar-button not found");
  }
}

document.addEventListener("DOMContentLoaded", function() {
  setInterval(ClickConnect, 1700000);
});

제대로 작동되는지 위 log를 통해서 확인하면 된다

 

'TIP' 카테고리의 다른 글

GCP 서버 VScode로 열기  (0) 2023.10.31
가상환경에서 react + Fast API 연동하기  (0) 2023.07.14
poetry 설치 및 실행 명령어 정리  (0) 2023.07.07
virtualenv 에러  (0) 2023.04.27
docker error  (0) 2023.04.25