MCPcopy Create free account
hub / github.com/IppClub/Dora-SSR / cancel

Method cancel

Source/Wasm/WasmRuntime.cpp:2936–2961  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2934}
2935
2936bool Git::cancel(int64_t jobId) {
2937#ifdef DORA_NO_WA
2938 DORA_UNUSED_PARAM(jobId);
2939 return false;
2940#else // !DORA_NO_WA
2941 auto& gitHandles = handles();
2942 auto it = gitHandles.find(jobId);
2943 if (it != gitHandles.end()) {
2944 auto handle = std::move(it->second);
2945 gitHandles.erase(it);
2946 bool canceled = WaGitCancel(jobId);
2947 std::string status = poll(jobId);
2948 if (!IsGitTerminalStatus(status)) {
2949 status = fmt::format(
2950 "{{\"id\":{},\"state\":\"canceled\",\"kind\":\"{}\",\"repoPath\":\"{}\",\"message\":\"canceled\"}}",
2951 jobId,
2952 EscapeJsonString(handle.kind),
2953 EscapeJsonString(handle.repoPath));
2954 }
2955 handle.callback(status);
2956 dispose(jobId);
2957 return canceled;
2958 }
2959 return WaGitCancel(jobId);
2960#endif // !DORA_NO_WA
2961}
2962
2963bool Git::dispose(int64_t jobId) {
2964#ifdef DORA_NO_WA

Callers

nothing calls this directly

Calls 11

moveFunction · 0.85
IsGitTerminalStatusFunction · 0.85
EscapeJsonStringFunction · 0.85
disposeFunction · 0.85
callbackMethod · 0.80
WaGitCancelFunction · 0.70
findMethod · 0.65
pollFunction · 0.50
formatFunction · 0.50
endMethod · 0.45
eraseMethod · 0.45

Tested by

no test coverage detected