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

Delete unnecessary methods and write them directry #2677

Merged
merged 1 commit into from
Oct 31, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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