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

Redmine 5.1.3 #19

Open
ashrafalzyoud opened this issue Jun 28, 2024 · 5 comments
Open

Redmine 5.1.3 #19

ashrafalzyoud opened this issue Jun 28, 2024 · 5 comments

Comments

@ashrafalzyoud
Copy link

It's compitable?!

@ToroLiu
@ogom
@devaroop
@constXife
@

@ogom
Copy link
Owner

ogom commented Jul 1, 2024

There are no gem dependencies so it may be compatible.

@ashrafalzyoud
Copy link
Author

@ogom
thx for replay
its give this error

redmine@redmine:~/redmine-5.1$ bundle exec rake redmine:plugins:migrate RAILS_ENV=production
rake aborted!
NameError: uninitialized constant Sidekiq::Extensions (NameError)

if Sidekiq::Extensions.respond_to?(:enable_delay!)
          ^^^^^^^^^^^^
/home/redmine/redmine-5.1/plugins/redmine_sidekiq/lib/redmine_sidekiq/configure.rb:4:in `<top (required)>'
<internal:/home/redmine/.rbenv/versions/3.2.3/lib/ruby/site_ruby/3.2.0/rubygems/core_ext/kernel_require.rb>:37:in `require'
<internal:/home/redmine/.rbenv/versions/3.2.3/lib/ruby/site_ruby/3.2.0/rubygems/core_ext/kernel_require.rb>:37:in `require'
/home/redmine/redmine-5.1/plugins/redmine_sidekiq/init.rb:3:in `<top (required)>'
/home/redmine/redmine-5.1/lib/redmine/plugin_loader.rb:31:in `load'
/home/redmine/redmine-5.1/lib/redmine/plugin_loader.rb:31:in `run_initializer'
/home/redmine/redmine-5.1/lib/redmine/plugin_loader.rb:108:in `each'
/home/redmine/redmine-5.1/lib/redmine/plugin_loader.rb:108:in `block in load'
/home/redmine/redmine-5.1/config/environment.rb:16:in `<top (required)>'
<internal:/home/redmine/.rbenv/versions/3.2.3/lib/ruby/site_ruby/3.2.0/rubygems/core_ext/kernel_require.rb>:37:in `require'
<internal:/home/redmine/.rbenv/versions/3.2.3/lib/ruby/site_ruby/3.2.0/rubygems/core_ext/kernel_require.rb>:37:in `require'
/home/redmine/.rbenv/versions/3.2.3/bin/bundle:25:in `load'
/home/redmine/.rbenv/versions/3.2.3/bin/bundle:25:in `<main>'
Tasks: TOP => redmine:plugins:migrate => environment
(See full trace by running task with --trace)

@ashrafalzyoud
Copy link
Author

ashrafalzyoud commented Jul 1, 2024

im edit this configure.rb

require 'sidekiq'

module RedmineSidekiq
  class Configure
    file = File.join(::Rails.root, 'plugins/redmine_sidekiq/config/sidekiq.yml')
    if File.exist?(file)
      config = YAML.load_file(file)[::Rails.env]
      redis_conf = config['redis'].symbolize_keys
    end

    Sidekiq.configure_server do |config|
      config.redis = redis_conf if redis_conf
    end

    Sidekiq.configure_client do |config|
      config.redis = redis_conf if redis_conf
    end

    # Remove the following lines because Sidekiq::Extensions and delay methods are no longer supported
    # Sidekiq::Extensions::ActiveRecord.module_eval do
    #   remove_method :delay if respond_to?(:delay)
    # end

    # Sidekiq::Extensions::ActionMailer.module_eval do
    #   remove_method :delay if respond_to?(:delay)
    # end

    # Sidekiq::Extensions::Klass.module_eval do
    #   remove_method :delay if respond_to?(:delay)
    # end

    # Sidekiq.remove_delay! if Sidekiq.methods.index(:remove_delay!)

    # Instead, use Sidekiq's built-in scheduling methods directly or through ActiveJob if needed
  end
end

and edit this file becasude this error also
undefined method before_filter' for SidekiqSandboxController:Class (NoMethodError) /home/redmine/redmine-5.1/plugins/redmine_sidekiq/app/controllers/sidekiq_sandbox_controller.rb:3:in class:SidekiqSandboxController'
/home/redmine/redmine-5.1/plugins/redmine_sidekiq/app/controllers/sidekiq_sandbox_controller.rb:1:in `<top (required)>'

class SidekiqSandboxController < ApplicationController
  unloadable
  before_action :require_admin

  def index
    @stats = Sidekiq::Stats.new
  end

  def perform_async
    name = params['name']
    count = params['count']
    jid = SandboxWorker.perform_async(name, count)
    flash[:notice] = "Enqueued job id: #{jid}" if jid
    redirect_to action: 'index'
  end

  def perform_in
    interval = params['interval'].to_i ||= 2
    jid = SandboxWorker.perform_in(interval.minutes)
    flash[:notice] = "Enqueued job id: #{jid}" if jid
    redirect_to action: 'index'
  end

  def perform_at
    interval = params['interval'].to_i ||= 2
    jid = SandboxWorker.perform_at(interval.minutes.from_now)
    flash[:notice] = "Enqueued job id: #{jid}" if jid
    redirect_to action: 'index'
  end
end

@ashrafalzyoud
Copy link
Author

can u check the tow edit files
@ogom

@ashrafalzyoud
Copy link
Author

Mr @ogom if you can help

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