Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Honeydew.filter returning an error #75

Closed
yuraxdrumz opened this issue Apr 10, 2019 · 3 comments
Closed

Honeydew.filter returning an error #75

yuraxdrumz opened this issue Apr 10, 2019 · 3 comments

Comments

@yuraxdrumz
Copy link

Hey,
I have a problem where I cant filter a job. I tried the example of queue + cancel and tried passing an fn that returns true to get all jobs from .filter but I always get an ArgumentError.

    #enqueue a job
    {:receive_work, [stages]} |> Honeydew.async({:global, :my_queue})

    # Status
    Honeydew.status({:global, :my_queue})
    |> Map.get(:queue)
    |> IO.inspect

      # find the job and cancel it
      # :ok =
      Honeydew.filter({:global, :my_queue}, %{task: {:receive_work, [stages]}})
      |> List.first
      |> Honeydew.cancel

The error:

 ** (MatchError) no match of right hand side value: {:error, %ArgumentError{message: "argument error"}}
        (honeydew) lib/honeydew.ex:191: Honeydew.filter/2
        (queue) lib/server/router.ex:133: anonymous fn/2 in App.Router.do_match/4
        (queue) lib/server/router.ex:2: App.Router.plug_builder_call/2
        (queue) lib/plug/error_handler.ex:64: App.Router."call (overridable 3)"/2
        (queue) lib/plug/debugger.ex:122: App.Router.call/2
        (plug_cowboy) lib/plug/cowboy/handler.ex:18: Plug.Adapters.Cowboy.Handler.upgrade/4
        (cowboy) src/cowboy_protocol.erl:442: :cowboy_protocol.execute/4

Thanks in advance!

@koudelka
Copy link
Owner

Hey there,

Could you post a self-contained reproduction? I'm not able to reproduce it, both a function and a task work for me.

@yuraxdrumz
Copy link
Author

Hey,
Thanks for replying so fast, I feel so stupid. You can close this issue. I had a worker, a queue and a client on different machines and I did not update the queue after a change to a shared module between those 3 processes. That is what gave the error, everything works now.
Thanks a lot!

@koudelka
Copy link
Owner

no worries, drop me a line if you encounter any issues. :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants