mirror of
https://github.com/vitodeploy/vito.git
synced 2025-04-19 18:01:37 +00:00
fix db transaction usage
This commit is contained in:
parent
bdfda05398
commit
0ec6a9dea2
@ -44,9 +44,8 @@ public function create(User $creator, array $input): Server
|
|||||||
'progress_step' => 'Initializing',
|
'progress_step' => 'Initializing',
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
DB::beginTransaction();
|
||||||
try {
|
try {
|
||||||
DB::beginTransaction();
|
|
||||||
|
|
||||||
if ($server->provider != 'custom') {
|
if ($server->provider != 'custom') {
|
||||||
$server->provider_id = $input['server_provider'];
|
$server->provider_id = $input['server_provider'];
|
||||||
}
|
}
|
||||||
|
@ -23,9 +23,8 @@ public function create(Server $server, array $input): Site
|
|||||||
{
|
{
|
||||||
$this->validateInputs($server, $input);
|
$this->validateInputs($server, $input);
|
||||||
|
|
||||||
|
DB::beginTransaction();
|
||||||
try {
|
try {
|
||||||
DB::beginTransaction();
|
|
||||||
|
|
||||||
$site = new Site([
|
$site = new Site([
|
||||||
'server_id' => $server->id,
|
'server_id' => $server->id,
|
||||||
'type' => $input['type'],
|
'type' => $input['type'],
|
||||||
|
@ -69,8 +69,8 @@ public function deployHook(): void
|
|||||||
*/
|
*/
|
||||||
public function destroyHook(): void
|
public function destroyHook(): void
|
||||||
{
|
{
|
||||||
|
DB::beginTransaction();
|
||||||
try {
|
try {
|
||||||
DB::beginTransaction();
|
|
||||||
$this->sourceControl->provider()->destroyHook($this->site->repository, $this->hook_id);
|
$this->sourceControl->provider()->destroyHook($this->site->repository, $this->hook_id);
|
||||||
$this->delete();
|
$this->delete();
|
||||||
DB::commit();
|
DB::commit();
|
||||||
|
@ -357,8 +357,8 @@ public function enableAutoDeployment(): void
|
|||||||
throw new SourceControlIsNotConnected($this->source_control);
|
throw new SourceControlIsNotConnected($this->source_control);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
DB::beginTransaction();
|
||||||
try {
|
try {
|
||||||
DB::beginTransaction();
|
|
||||||
$gitHook = new GitHook([
|
$gitHook = new GitHook([
|
||||||
'site_id' => $this->id,
|
'site_id' => $this->id,
|
||||||
'source_control_id' => $this->sourceControl()->id,
|
'source_control_id' => $this->sourceControl()->id,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user