<commit_before># Puma - Runit
require 'capistrano/puma/config'
require 'capistrano/base_helper/runit_base'

Capistrano::Configuration.instance(true).load do
  after "deploy:setup", "puma:runit:setup"

  # enable service after update in case it has not been setup or is disabled
  # Service should probably be started as well?
  after "deploy:update", "puma:runit:enable"
  before "puma:runit:setup", "puma:runit:flush_sockets"
  after "puma:runit:quit", "puma:runit:stop"

  namespace :puma do
    namespace :runit do
      desc "Setup Puma runit-service"
      task :setup, :roles => :app do
        Capistrano::BaseHelper.prepare_path(File.join(fetch(:shared_path), "sockets"), fetch(:user), fetch(:group))

        # Create puma configuration file
        Capistrano::BaseHelper::generate_and_upload_config(fetch(:puma_local_config), fetch(:puma_remote_config))

        # Create runit config
        Capistrano::RunitBase.create_service_dir(puma_runit_service_name)
        Capistrano::BaseHelper::generate_and_upload_config(puma_runit_local_run, Capistrano::RunitBase.remote_run_config_path(puma_runit_service_name))<commit_msg>Stop before quit<commit_after># Puma - Runit
require 'capistrano/puma/config'
require 'capistrano/base_helper/runit_base'

Capistrano::Configuration.instance(true).load do
  after "deploy:setup", "puma:runit:setup"

  # enable service after update in case it has not been setup or is disabled
  # Service should probably be started as well?
  after "deploy:update", "puma:runit:enable"
  before "puma:runit:setup", "puma:runit:flush_sockets"
  before "puma:runit:quit", "puma:runit:stop"

  namespace :puma do
    namespace :runit do
      desc "Setup Puma runit-service"
      task :setup, :roles => :app do
        Capistrano::BaseHelper.prepare_path(File.join(fetch(:shared_path), "sockets"), fetch(:user), fetch(:group))

        # Create puma configuration file
        Capistrano::BaseHelper::generate_and_upload_config(fetch(:puma_local_config), fetch(:puma_remote_config))

        # Create runit config
        Capistrano::RunitBase.create_service_dir(puma_runit_service_name)
        Capistrano::BaseHelper::generate_and_upload_config(puma_runit_local_run, Capistrano::RunitBase.remote_run_config_path(puma_runit_service_name))
{'fraction_non_alphanumeric': 0.1066079295154185, 'fraction_numerical': 0.0, 'mean_word_length': 5.507163323782235, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '3074591', 'n_tokens_mistral': 749, 'n_tokens_neox': 734, 'n_words': 147}