Added mock build. Part 5
This commit is contained in:
@@ -28,9 +28,13 @@ class BuildTask < Sequel::Model(:buildtask)
|
||||
end
|
||||
|
||||
class DBase
|
||||
attr :error, :last_id
|
||||
attr :error, :last_id, :cfg
|
||||
|
||||
def creategit(project_name, description)
|
||||
def initialize(cfg)
|
||||
@cfg = cfg
|
||||
end
|
||||
|
||||
def creategit(project_name, description, cfg)
|
||||
@error = nil
|
||||
data = Repos.where(reponame: project_name).first
|
||||
if data.nil?
|
||||
@@ -238,4 +242,12 @@ class DBase
|
||||
def get_build_task_process_log(build_id)
|
||||
BuildTask.where(id: build_id.to_i).first
|
||||
end
|
||||
|
||||
def before_fork()
|
||||
Sequel::DATABASES.each(&:disconnect)
|
||||
end
|
||||
|
||||
def after_fork()
|
||||
Sequel.connect(@cfg.get_db)
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user