feat(worker): add the vbs remote-execution worker client
This commit is contained in:
1 parent
1ae72e4d07
commit
0674b7f9fe
10 files changed
+423
-1
No files matched your search
@@ -1174,4 +1174,23 @@ std::size_t StateStore::recorded_action_count() const {
|
||||
return db ? db->actions.size() : 0;
|
||||
}
|
||||
|
||||
Void::Result::Result<std::string, Void::Result::Error>
|
||||
StateStore::export_action_record_json(std::string_view action_key) const {
|
||||
auto lock = Platform::FileLock::acquire(lock_file_, Platform::LockMode::Shared);
|
||||
if (!lock) {
|
||||
return std::unexpected{lock.error()};
|
||||
}
|
||||
auto db = load_db_locked();
|
||||
if (!db) {
|
||||
return std::unexpected{db.error()};
|
||||
}
|
||||
const auto it = db->actions.find(std::string{action_key});
|
||||
if (it == db->actions.end()) {
|
||||
return std::unexpected{
|
||||
make_error(Void::System::SystemErrorCode::not_found,
|
||||
std::format("no local action record for '{}'", action_key))};
|
||||
}
|
||||
return serialize_action(it->second);
|
||||
}
|
||||
|
||||
} // namespace Void::Build::State
|
||||
Reference in new issue
Block a user