1+ use self :: budget:: { cb_log_long_running, cb_noop} ;
12use self :: budget:: { energy_from_elapsed, with_timeout_and_cb_every} ;
23use self :: error:: {
34 catch_exception, exception_already_thrown, log_traceback, BufferTooSmall , CodeError , ExcResult , JsStackTrace ,
@@ -17,7 +18,6 @@ use crate::host::wasm_common::{RowIters, TimingSpanSet};
1718use crate :: host:: wasmtime:: EPOCH_TICKS_PER_SECOND ;
1819use crate :: host:: Scheduler ;
1920use crate :: { module_host_context:: ModuleCreationContext , replica_context:: ReplicaContext } ;
20- use core:: ffi:: c_void;
2121use core:: str;
2222use spacetimedb_client_api_messages:: energy:: ReducerBudget ;
2323use spacetimedb_datastore:: locking_tx_datastore:: MutTxId ;
@@ -316,17 +316,6 @@ impl JsInstance {
316316
317317 self . common
318318 . call_reducer_with_tx ( replica_ctx, tx, params, log_traceback, |tx, op, budget| {
319- /// Called by a thread separate to V8 execution
320- /// every [`EPOCH_TICKS_PER_SECOND`] ticks (~every 1 second)
321- /// to log that the reducer is still running.
322- extern "C" fn cb_log_long_running ( isolate : & mut Isolate , _: * mut c_void ) {
323- let env = env_on_isolate ( isolate) ;
324- let database = env. instance_env . replica_ctx . database_identity ;
325- let reducer = env. reducer_name ( ) ;
326- let dur = env. reducer_start ( ) . elapsed ( ) ;
327- tracing:: warn!( reducer, ?database, "JavaScript has been running for {dur:?}" ) ;
328- }
329-
330319 // TODO(v8): snapshots
331320 // Prepare the isolate with the env.
332321 let mut isolate = Isolate :: new ( <_ >:: default ( ) ) ;
@@ -504,11 +493,10 @@ fn call_free_fun<'scope>(
504493fn extract_description ( program : & str ) -> Result < RawModuleDef , DescribeError > {
505494 let budget = ReducerBudget :: DEFAULT_BUDGET ;
506495 let callback_every = EPOCH_TICKS_PER_SECOND ;
507- extern "C" fn callback ( _: & mut Isolate , _: * mut c_void ) { }
508496
509497 let mut isolate = Isolate :: new ( <_ >:: default ( ) ) ;
510498 let handle = isolate. thread_safe_handle ( ) ;
511- with_timeout_and_cb_every ( handle, callback_every, callback , budget, || {
499+ with_timeout_and_cb_every ( handle, callback_every, cb_noop , budget, || {
512500 with_scope ( & mut isolate, |scope| {
513501 eval_user_module_catch ( scope, program) . map_err ( DescribeError :: Setup ) ?;
514502
0 commit comments