Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
automatic_updates-3262284
Manage
Activity
Members
Labels
Plan
Custom issue tracker
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Issue forks
automatic_updates-3262284
Commits
a9b701c7
Commit
a9b701c7
authored
5 years ago
by
Lucas Hedding
Committed by
Lucas Hedding
5 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Issue
#3094513
by heddn: Try/catch /Exception to rollback entire update if anything happens
parent
86e4616a
No related branches found
Branches containing commit
Tags
8.x-3.0-alpha4
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
InPlaceUpdate.php
+12
-2
12 additions, 2 deletions
InPlaceUpdate.php
with
12 additions
and
2 deletions
InPlaceUpdate.php
+
12
−
2
View file @
a9b701c7
...
...
@@ -63,8 +63,18 @@ class InPlaceUpdate {
$modified
=
self
::
checkModifiedFiles
(
$project_name
,
$archive
);
if
(
!
$modified
&&
self
::
backup
(
$archive
,
$project_root
))
{
watchdog
(
'automatic_updates'
,
'In place update has started.'
,
[],
WATCHDOG_INFO
);
$success
=
self
::
processUpdate
(
$archive
,
$project_root
);
watchdog
(
'automatic_updates'
,
'In place update has finished.'
,
[],
WATCHDOG_INFO
);
try
{
$success
=
self
::
processUpdate
(
$archive
,
$project_root
);
watchdog
(
'automatic_updates'
,
'In place update has finished.'
,
[],
WATCHDOG_INFO
);
}
catch
(
\Throwable
$throwable
)
{
watchdog
(
'automatic_updates'
,
'In place update has failed.'
,
[],
WATCHDOG_ERROR
);
watchdog_exception
(
$throwable
);
}
catch
(
\Exception
$exception
)
{
watchdog
(
'automatic_updates'
,
'In place update has failed.'
,
[],
WATCHDOG_ERROR
);
watchdog_exception
(
$exception
);
}
$result
=
automatic_updates_exec_command
(
'updatedb:status'
);
if
(
!
empty
(
$result
[
'return_code'
]
||
!
empty
(
$result
[
'output'
])))
{
// Rollback if there are database updates in the update.
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment