MCPcopy Create free account
hub / github.com/deepseek-ai/3FS / worker

Method worker

src/client/cli/admin/ScanTree.cc:95–112  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

93 }
94
95 CoTask<void> worker() {
96 while (true) {
97 auto dequeue =
98 co_await folly::coro::co_awaitTry(folly::coro::co_withCancellation(cancel_.getToken(), queue_.dequeue()));
99 if (UNLIKELY(dequeue.hasException())) {
100 break;
101 }
102
103 auto &task = **dequeue;
104 auto result = co_await handle(task);
105 if (result.hasError()) {
106 broken_.wlock()->push_back({task.path, result.error()});
107 }
108 pending_--;
109 processed_++;
110 XLOGF_EVERY_MS(INFO, 1000, "scan-tree processed {} tasks", processed_.load());
111 }
112 }
113
114 CoTryTask<void> handle(Task &task) {
115 if (!task.inode.has_value()) {

Callers 1

initMethod · 0.80

Calls 6

hasErrorMethod · 0.80
push_backMethod · 0.80
handleFunction · 0.70
dequeueMethod · 0.45
errorMethod · 0.45
loadMethod · 0.45

Tested by

no test coverage detected