You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
self.warning('Unusual value for USE_PORTAL: %s', use_portal_config)
1941
1943
returnFalse
1942
1944
1943
-
def_get_portal_runid(self) ->int:
1945
+
def_establish_portal_runid(self) ->None:
1944
1946
"""Get the runid Jupyter and the Portal will associate with this run.
1945
1947
Generally this will be the runid that the portal emits, but we will try to allow for fallbacks in certain cases.
1946
1948
1947
-
If value is < 0, we were unable to get the portal runid.
1948
-
"""
1949
+
If value >= 0, we have the portal runid
1950
+
If value == -1, we have not yet set the portal runid
1951
+
If value == -2, we have tried and failed to get the portal runid, and will not try again
1949
1952
1950
-
# already successful
1951
-
ifself._portal_runid>=0:
1952
-
returnself._portal_runid
1953
+
You should explicitly check the value of self._portal_runid after this function, as this function is concerned with setting the value in a thread-safe context.
1954
+
"""
1953
1955
1954
-
# already failed
1955
-
ifself._portal_runid==-2:
1956
-
return-2
1956
+
# first, check if portal_runid was already set
1957
+
ifself._portal_runid_event.is_set():
1958
+
return
1957
1959
1958
1960
# first, check to see if we even want to use the portal
1959
1961
ifnotself._should_use_portal():
1960
1962
self.warning('web portal disabled')
1961
1963
self._portal_runid=-2
1962
-
return-2
1964
+
self._portal_runid_event.set()
1965
+
return
1963
1966
1964
1967
# next, check to see if the portal URL was even initialized, fall back if not
:param source_notebook_path: location you want to load the source notebook from. This can be either an absolute path, or an IPS-appropriate relative path.
2013
2027
:param dest_notebook_name: (optional, default None) filename of the notebook to use when saving it to the IPS Portal. If not provided, this will defauly to the filename of the source notebook.
2014
2028
"""
2015
-
portal_runid=self._get_portal_runid()
2016
-
ifportal_runid<0:
2029
+
# have we initialized a runid yet? if not, block this function call until we can establish or not establish one
0 commit comments