rename stack_sync_worker to stack_bootstrap_worker

This commit is contained in:
Anton Chuchkalov 2015-07-30 12:18:55 +02:00
parent a018c03ca1
commit ea2046c932
5 changed files with 13 additions and 9 deletions

View File

@ -19,7 +19,7 @@ module Devops
stack.owner = owner_from_request
Devops::Db.connector.stack_insert(stack)
file = JobStarter.start_job(:worker, :sync_stack_till_not_in_progress,
file = JobStarter.start_job(:worker, :stack_bootstrap,
provider: stack.provider,
stack_id: stack.id,
request: @request

View File

@ -1,6 +1,6 @@
require 'json'
require 'lib/stack_presets/factory'
require 'workers/stack_sync_worker'
require 'workers/stack_bootstrap_worker'
require 'workers/job_starter'
require_relative "request_handler"
@ -23,7 +23,7 @@ module Devops
stack.owner = owner_from_request
Devops::Db.connector.stack_insert(stack)
file = JobStarter.start_job(:worker, :sync_stack_till_not_in_progress,
file = JobStarter.start_job(:worker, :stack_bootstrap,
provider: stack.provider,
stack_id: stack.id,
request: @request

View File

@ -5,7 +5,7 @@ module StackCommands
include ServerCommands
extend self
def sync_stack_till_not_in_progress_proc
def stack_bootstrap_proc
lambda do |out, stack, mongo|
# two tries each 4 seconds, then 5 tries each 10 seconds, then 5 tries each minute.
sleep_times = [4]*2 + [10]*5 + [60]*5
@ -29,8 +29,12 @@ module StackCommands
end
end
def bootstrap_stack_servers
end
CommandsStorage.add_job_lambda(
sync_stack_till_not_in_progress: sync_stack_till_not_in_progress_proc
stack_bootstrap: stack_bootstrap_proc
)
end

View File

@ -4,7 +4,7 @@ require File.join(root, "create_server_worker")
require File.join(root, "deploy_worker")
require File.join(root, "bootstrap_worker")
require File.join(root, "project_test_worker")
require File.join(root, "stack_sync_worker")
require File.join(root, "stack_bootstrap_worker")
config = {}
#require File.join(root, "../proxy")

View File

@ -5,7 +5,7 @@ require "db/mongo/models/project"
require "db/mongo/models/report"
require 'workers/workers_storage'
class StackSyncWorker < Worker
class StackBootstrapWorker < Worker
include StackCommands
# besides options came from JobStarter we need:
@ -16,7 +16,7 @@ class StackSyncWorker < Worker
stack = mongo.stack(options['stack_id'])
save_report(mongo, stack, file)
status = sync_stack_till_not_in_progress_proc.call(out, stack, mongo)
status = stack_bootstrap_proc.call(out, stack, mongo)
persist_stack_servers_in_mongo!(mongo, stack, provider)
status
end
@ -65,4 +65,4 @@ class StackSyncWorker < Worker
end
end
WorkersStorage.add_worker(sync_stack_till_not_in_progress: StackSyncWorker)
WorkersStorage.add_worker(stack_bootstrap: StackBootstrapWorker)