Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit ed63178

Browse files
committedSep 23, 2024·
job timeout is chrono ms
1 parent 5946c3e commit ed63178

File tree

3 files changed

+6
-5
lines changed

3 files changed

+6
-5
lines changed
 

‎core/parachain/pvf/pvf_impl.cpp

+4-2
Original file line numberDiff line numberDiff line change
@@ -320,7 +320,7 @@ namespace kagome::parachain {
320320
WasmCb cb) const {
321321
CB_TRY(auto executor_params,
322322
sessionParams(*parachain_api_, receipt.descriptor.relay_parent));
323-
const auto& context_params = executor_params.context_params;
323+
const auto &context_params = executor_params.context_params;
324324

325325
constexpr auto name = "validate_block";
326326
CB_TRYV(pvf_pool_->precompile(code_hash, code_zstd, context_params));
@@ -354,7 +354,9 @@ namespace kagome::parachain {
354354
}
355355
cb(scale::decode<ValidationResult>(r.value()));
356356
},
357-
.timeout = executor_params.pvf_exec_timeout_backing_ms,
357+
.timeout =
358+
std::chrono::milliseconds{
359+
executor_params.pvf_exec_timeout_backing_ms},
358360
});
359361
}
360362

‎core/parachain/pvf/workers.cpp

+1-2
Original file line numberDiff line numberDiff line change
@@ -219,8 +219,7 @@ namespace kagome::parachain {
219219
timeout->reset();
220220
};
221221
*timeout = scheduler_->scheduleWithHandle(
222-
[cb]() mutable { cb(std::errc::timed_out); },
223-
std::chrono::milliseconds{job.timeout});
222+
[cb]() mutable { cb(std::errc::timed_out); }, job.timeout);
224223
worker.process->writeScale(PvfWorkerInput{job.args},
225224
[cb](outcome::result<void> r) mutable {
226225
if (not r) {

‎core/parachain/pvf/workers.hpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ namespace kagome::parachain {
4646
PvfWorkerInputCodePath code_path;
4747
Buffer args;
4848
Cb cb;
49-
uint64_t timeout = 0;
49+
std::chrono::milliseconds timeout{0};
5050
};
5151
void execute(Job &&job);
5252

0 commit comments

Comments
 (0)
Please sign in to comment.