mirror of
https://github.com/mii443/tokenizers.git
synced 2025-08-22 16:25:30 +00:00
Node - Fix tasks count
This commit is contained in:
@ -44,7 +44,7 @@ declare_types! {
|
||||
let this = cx.this();
|
||||
let guard = cx.lock();
|
||||
let count = std::sync::Arc::strong_count(&this.borrow(&guard).running_task);
|
||||
count
|
||||
if count > 0 { count - 1 } else { 0 }
|
||||
};
|
||||
Ok(cx.number(running as f64).upcast())
|
||||
}
|
||||
@ -71,7 +71,7 @@ declare_types! {
|
||||
count
|
||||
};
|
||||
if running > 1 {
|
||||
println!("{} running tasks", running);
|
||||
println!("{} running tasks", running - 1);
|
||||
return cx.throw_error("Cannot modify the tokenizer while there are running tasks");
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user