mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-04-09 22:43:10 +08:00
RN: Change Time Drift Error into Warning
Summary: Changes the time drift error into a warning that will only get logged once per debugging session. Reviewed By: jingc Differential Revision: D3539067 fbshipit-source-id: 357db15750d867a91c39b5fc5fd6ed4ae2852bc7
This commit is contained in:
committed by
Facebook Github Bot 8
parent
6d3c7b8a4c
commit
ed4db631fa
@@ -17,4 +17,6 @@ import com.facebook.react.bridge.WritableArray;
|
||||
public interface JSTimersExecution extends JavaScriptModule {
|
||||
|
||||
public void callTimers(WritableArray timerIDs);
|
||||
|
||||
public void emitTimeDriftWarning(String warningMessage);
|
||||
}
|
||||
|
||||
@@ -226,11 +226,10 @@ public final class Timing extends ReactContextBaseJavaModule implements Lifecycl
|
||||
if (mDevSupportManager.getDevSupportEnabled()) {
|
||||
long driftTime = Math.abs(remoteTime - deviceTime);
|
||||
if (driftTime > 60000) {
|
||||
throw new RuntimeException(
|
||||
"Debugger and device times have drifted by more than 60s." +
|
||||
"Please correct this by running adb shell " +
|
||||
"\"date `date +%m%d%H%M%Y.%S`\" on your debugger machine."
|
||||
);
|
||||
getReactApplicationContext().getJSModule(executorToken, JSTimersExecution.class)
|
||||
.emitTimeDriftWarning(
|
||||
"Debugger and device times have drifted by more than 60s. Please correct this by " +
|
||||
"running adb shell \"date `date +%m%d%H%M%Y.%S`\" on your debugger machine.");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user