nebulab / cangaroo

Connect Any App to Any Service
https://github.com/nebulab/cangaroo
MIT License
107 stars 18 forks source link

Namespace PerformFlow in BaseJob#restart_flow to prevent loading issue #56

Closed davidlaprade closed 6 years ago

davidlaprade commented 6 years ago

This prevents:

ArgumentError: A copy of Cangaroo::BaseJob has
been removed from the module tree but is still active!

This issue prevents PollJobs from:

  1. updating poll timestamps
  2. processing returned payloads

To Reproduce

git clone https://github.com/davidlaprade/cangaroo-loading-issue
cd cangaroo-loading-issue
bundle
bundle exec rake db:create db:migrate db:seed

Open 2 separate shells:

# in the first shell
bundle exec rails s -p 3100 # start the rails server

# in the second shell
bin/delayed_job start # start a worker process
bundle exec rake cangaroo:poll # add a poll job to the queue
tail -f log/delayed_job.log # watch what the worker does

Once the MyPollShipmentJob runs, you will see the following error in the worker log file:

Job ActiveJob::QueueAdapters::DelayedJobAdapter::JobWrapper (id=5) (queue=cangaroo)
FAILED (1 prior attempts) with ArgumentError: A copy of Cangaroo::BaseJob has
been removed from the module tree but is still active!
davidlaprade commented 6 years ago

@AlessioRocco Friendly ping :)