Added mock build. Part 5

This commit is contained in:
alexey
2025-03-14 00:06:42 +03:00
parent 2059e19d0d
commit 9cf2aabc65
6 changed files with 207 additions and 14 deletions

View File

@@ -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