Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Léo-Paul Géneau
gitlab-ce
Commits
c6723ed3
Commit
c6723ed3
authored
Feb 15, 2016
by
Kamil Trzcinski
Committed by
James Edwards-Jones
Jan 31, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Updated configuration saving
parent
7f12cb0e
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
6 deletions
+6
-6
app/services/projects/update_pages_configuration_service.rb
app/services/projects/update_pages_configuration_service.rb
+6
-6
No files found.
app/services/projects/update_pages_configuration_service.rb
View file @
c6723ed3
...
@@ -7,7 +7,7 @@ module Projects
...
@@ -7,7 +7,7 @@ module Projects
end
end
def
execute
def
execute
update_file
(
pages_config_file
,
pages_config
)
update_file
(
pages_config_file
,
pages_config
.
to_json
)
reload_daemon
reload_daemon
success
success
rescue
=>
e
rescue
=>
e
...
@@ -52,18 +52,18 @@ module Projects
...
@@ -52,18 +52,18 @@ module Projects
def
update_file
(
file
,
data
)
def
update_file
(
file
,
data
)
unless
data
unless
data
File
.
rm
(
file
,
force:
true
)
File
Utils
.
remove
(
file
,
force:
true
)
return
return
end
end
temp_file
=
"
#{
file
}
.
#{
SecureRandom
.
hex
(
16
)
}
"
temp_file
=
"
#{
file
}
.
#{
SecureRandom
.
hex
(
16
)
}
"
File
.
open
(
temp_file
,
'w'
)
do
|
f
ile
|
File
.
open
(
temp_file
,
'w'
)
do
|
f
|
f
ile
.
write
(
data
)
f
.
write
(
data
)
end
end
File
.
mv
(
temp_file
,
file
,
force:
true
)
File
Utils
.
move
(
temp_file
,
file
,
force:
true
)
ensure
ensure
# In case if the updating fails
# In case if the updating fails
File
.
rm
(
temp_file
,
force:
true
)
File
Utils
.
remove
(
temp_file
,
force:
true
)
end
end
end
end
end
end
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment