Skip to content

Commit

Permalink
take out app_id from step state for now since it's not used
Browse files Browse the repository at this point in the history
  • Loading branch information
darwin67 committed Oct 10, 2024
1 parent 8105645 commit 7f03b21
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
3 changes: 1 addition & 2 deletions inngest/src/handler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -194,8 +194,7 @@ impl<T, E> Handler<T, E> {
},
};

let app_id = self.inngest.app_id();
let step_tool = StepTool::new(&app_id, &data.steps);
let step_tool = StepTool::new(&data.steps);

match std::panic::catch_unwind(AssertUnwindSafe(|| (func.func)(input, step_tool.clone()))) {
Ok(fut) => {
Expand Down
8 changes: 3 additions & 5 deletions inngest/src/step_tool.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ mod state {

/// Keep this private so that we can hide the mutex and prevent deadlocks
struct InnerState {
app_id: String,
state: HashMap<String, Option<Value>>,
indices: HashMap<String, u64>,
genop: Vec<GeneratorOpCode>,
Expand All @@ -73,10 +72,9 @@ mod state {
}

impl State {
pub fn new(app_id: impl Into<String>, state: &HashMap<String, Option<Value>>) -> Self {
pub fn new(state: &HashMap<String, Option<Value>>) -> Self {
State {
inner: Arc::new(RwLock::new(InnerState {
app_id: app_id.into(),
state: state.clone(),
indices: HashMap::new(),
genop: Vec::new(),
Expand Down Expand Up @@ -135,9 +133,9 @@ impl<E> UserProvidedError<'_> for E where
}

impl Step {
pub fn new(app_id: impl Into<String>, state: &HashMap<String, Option<Value>>) -> Self {
pub fn new(state: &HashMap<String, Option<Value>>) -> Self {
Step {
state: State::new(app_id, state),
state: State::new(state),
}
}

Expand Down

0 comments on commit 7f03b21

Please sign in to comment.