1+ use self :: budget:: { cb_log_long_running, cb_noop} ;
12use self :: budget:: { energy_from_elapsed, with_timeout_and_cb_every} ;
23use self :: de:: { deserialize_js, property} ;
34use self :: error:: {
@@ -20,7 +21,6 @@ use crate::host::wasm_common::{RowIters, TimingSpanSet};
2021use crate :: host:: wasmtime:: EPOCH_TICKS_PER_SECOND ;
2122use crate :: host:: { ArgsTuple , Scheduler } ;
2223use crate :: { module_host_context:: ModuleCreationContext , replica_context:: ReplicaContext } ;
23- use core:: ffi:: c_void;
2424use core:: str;
2525use spacetimedb_client_api_messages:: energy:: ReducerBudget ;
2626use spacetimedb_datastore:: locking_tx_datastore:: MutTxId ;
@@ -319,17 +319,6 @@ impl JsInstance {
319319
320320 self . common
321321 . call_reducer_with_tx ( replica_ctx, tx, params, log_traceback, |tx, op, budget| {
322- /// Called by a thread separate to V8 execution
323- /// every [`EPOCH_TICKS_PER_SECOND`] ticks (~every 1 second)
324- /// to log that the reducer is still running.
325- extern "C" fn cb_log_long_running ( isolate : & mut Isolate , _: * mut c_void ) {
326- let env = env_on_isolate ( isolate) ;
327- let database = env. instance_env . replica_ctx . database_identity ;
328- let reducer = env. reducer_name ( ) ;
329- let dur = env. reducer_start ( ) . elapsed ( ) ;
330- tracing:: warn!( reducer, ?database, "JavaScript has been running for {dur:?}" ) ;
331- }
332-
333322 // TODO(v8): snapshots
334323 // Prepare the isolate with the env.
335324 let mut isolate = Isolate :: new ( <_ >:: default ( ) ) ;
@@ -595,11 +584,10 @@ fn call_reducer_fun<'scope>(
595584fn extract_description ( program : & str ) -> Result < RawModuleDef , DescribeError > {
596585 let budget = ReducerBudget :: DEFAULT_BUDGET ;
597586 let callback_every = EPOCH_TICKS_PER_SECOND ;
598- extern "C" fn callback ( _: & mut Isolate , _: * mut c_void ) { }
599587
600588 let mut isolate = Isolate :: new ( <_ >:: default ( ) ) ;
601589 let handle = isolate. thread_safe_handle ( ) ;
602- with_timeout_and_cb_every ( handle, callback_every, callback , budget, || {
590+ with_timeout_and_cb_every ( handle, callback_every, cb_noop , budget, || {
603591 with_scope ( & mut isolate, |scope| {
604592 let ( def, ..) = extract_description_raw ( scope, program) ?;
605593 Ok ( def)
0 commit comments