Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-workhorse
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
1
Merge Requests
1
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
nexedi
gitlab-workhorse
Commits
e696f2ac
Commit
e696f2ac
authored
Feb 20, 2017
by
Jacob Vosmaer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make tempfile write errors permanent
parent
f0fd9fdb
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
2 deletions
+13
-2
internal/helper/writeafterreader.go
internal/helper/writeafterreader.go
+13
-2
No files found.
internal/helper/writeafterreader.go
View file @
e696f2ac
...
@@ -69,15 +69,26 @@ type coupledWriter struct {
...
@@ -69,15 +69,26 @@ type coupledWriter struct {
tempfile
*
os
.
File
tempfile
*
os
.
File
tempfileMutex
sync
.
Mutex
tempfileMutex
sync
.
Mutex
writeError
error
}
}
func
(
w
*
coupledWriter
)
Write
(
data
[]
byte
)
(
int
,
error
)
{
func
(
w
*
coupledWriter
)
Write
(
data
[]
byte
)
(
int
,
error
)
{
if
w
.
writeError
!=
nil
{
return
0
,
w
.
writeError
}
if
w
.
busyReader
.
IsBusy
()
{
if
w
.
busyReader
.
IsBusy
()
{
return
w
.
tempfileWrite
(
data
)
n
,
err
:=
w
.
tempfileWrite
(
data
)
if
err
!=
nil
{
w
.
writeError
=
fmt
.
Errorf
(
"coupledWriter: %v"
,
err
)
}
return
n
,
w
.
writeError
}
}
if
err
:=
w
.
Flush
();
err
!=
nil
{
if
err
:=
w
.
Flush
();
err
!=
nil
{
return
0
,
err
w
.
writeError
=
fmt
.
Errorf
(
"coupledWriter: %v"
,
err
)
return
0
,
w
.
writeError
}
}
return
w
.
Writer
.
Write
(
data
)
return
w
.
Writer
.
Write
(
data
)
...
...
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