Docker_manager rake task running twice

I’m adding a rake task to the docker_manager plugin but I’m finding that the task is running twice when I invoke it. In its simplest form, I can add testing.rake to lib/tasks with the following contents:

# frozen_string_literal: true

desc "A test"
task "docker_manager:test do
  puts "test"
end

With this result:

/var/www/discourse# rake docker_manager:test --trace
** Invoke docker_manager:test (first_time)
** Execute docker_manager:test
test
test

I’ve confirmed that this is not a general problem with tasks in plugins by adding the same rake file to the poll plugin with this result:

/var/www/discourse# mv plugins/docker_manager/lib/tasks/testing.rake plugins/poll/lib/tasks/
/var/www/discourse# rake docker_manager:test --trace
** Invoke docker_manager:test (first_time)
** Execute docker_manager:test
test

I haven’t yet been able to find anything obvious in the two plugins that might be preventing/causing this so I’m hoping someone might be able to offer suggestions for what could be preventing this in poll or causing it in docker_manager.

2 Likes