<commit_before># frozen_string_literal: true
module Drivers
  module Worker
    class Sidekiq < Drivers::Worker::Base
      adapter :sidekiq
      allowed_engines :sidekiq
      output filter: [:config, :process_count, :require, :syslog]

      def configure(context)
        add_sidekiq_config(context)
        add_sidekiq_monit(context)
      end

      def after_deploy(context)
        context.execute 'monit reload'
        (1..process_count).each do |process_number|
          context.execute "monit restart sidekiq_#{app['shortname']}-#{process_number}" do
            retries 3
          end
        end
      end
      alias after_undeploy after_deploy

      private

      def add_sidekiq_config(context)
        deploy_to = deploy_dir(app)<commit_msg>fix: Reload monit after restarting services<commit_after># frozen_string_literal: true
module Drivers
  module Worker
    class Sidekiq < Drivers::Worker::Base
      adapter :sidekiq
      allowed_engines :sidekiq
      output filter: [:config, :process_count, :require, :syslog]

      def configure(context)
        add_sidekiq_config(context)
        add_sidekiq_monit(context)
      end

      def after_deploy(context)
        (1..process_count).each do |process_number|
          context.execute "monit restart sidekiq_#{app['shortname']}-#{process_number}" do
            retries 3
          end
        end
        context.execute 'monit reload'
      end
      alias after_undeploy after_deploy

      private

      def add_sidekiq_config(context)
        deploy_to = deploy_dir(app)
{'fraction_non_alphanumeric': 0.07647814910025708, 'fraction_numerical': 0.002570694087403599, 'mean_word_length': 2.68957345971564, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4022872', 'n_tokens_mistral': 478, 'n_tokens_neox': 460, 'n_words': 106}