Skip to content

Commit

Permalink
Merge pull request #2677 from ganmacs/no-need-to-be-method
Browse files Browse the repository at this point in the history
Delete unnecessary methods and write them directry
  • Loading branch information
ganmacs authored Oct 31, 2019
2 parents 0ac4f42 + 27de484 commit 5d82dce
Showing 1 changed file with 7 additions and 23 deletions.
30 changes: 7 additions & 23 deletions lib/fluent/supervisor.rb
Original file line number Diff line number Diff line change
Expand Up @@ -526,11 +526,11 @@ def run_worker

main_process do
create_socket_manager if @standalone_worker
change_privilege if @standalone_worker
ServerEngine::Privilege.change(@chuser, @chgroup) if @standalone_worker
MessagePackFactory.init
init_engine
run_configure
run_engine
Fluent::Engine.init(@system_config)
Fluent::Engine.run_configure(@conf)
Fluent::Engine.run
self.class.cleanup_resources if @standalone_worker
exit 0
end
Expand Down Expand Up @@ -602,10 +602,10 @@ def dry_run_cmd
def dry_run
begin
Fluent::Engine.dry_run_mode = true
change_privilege
ServerEngine::Privilege.change(@chuser, @chgroup)
MessagePackFactory.init
init_engine
run_configure
Fluent::Engine.init(@system_config)
Fluent::Engine.run_configure(@conf)
rescue Fluent::ConfigError => e
$log.error "config error", file: @config_path, error: e
$log.debug_backtrace
Expand Down Expand Up @@ -819,21 +819,5 @@ def build_system_config(conf)
system_config.overwrite_variables(opt)
system_config
end

def change_privilege
ServerEngine::Privilege.change(@chuser, @chgroup)
end

def init_engine
Fluent::Engine.init(@system_config)
end

def run_configure
Fluent::Engine.run_configure(@conf)
end

def run_engine
Fluent::Engine.run
end
end
end

0 comments on commit 5d82dce

Please sign in to comment.