Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
canifa_note
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Vũ Hoàng Anh
canifa_note
Commits
f66c7500
Commit
f66c7500
authored
Dec 31, 2025
by
Johnny
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
chore: simplify attachment file writing
parent
bd02de98
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
5 additions
and
7 deletions
+5
-7
oauth2.go
plugin/idp/oauth2/oauth2.go
+2
-1
scheduler.go
plugin/scheduler/scheduler.go
+2
-0
webhook.go
plugin/webhook/webhook.go
+1
-1
attachment_service.go
server/router/api/v1/attachment_service.go
+0
-5
No files found.
plugin/idp/oauth2/oauth2.go
View file @
f66c7500
...
...
@@ -90,11 +90,12 @@ func (p *IdentityProvider) UserInfo(token string) (*idp.IdentityProviderUserInfo
if
err
!=
nil
{
return
nil
,
errors
.
Wrap
(
err
,
"failed to get user information"
)
}
defer
resp
.
Body
.
Close
()
body
,
err
:=
io
.
ReadAll
(
resp
.
Body
)
if
err
!=
nil
{
return
nil
,
errors
.
Wrap
(
err
,
"failed to read response body"
)
}
defer
resp
.
Body
.
Close
()
var
claims
map
[
string
]
any
if
err
:=
json
.
Unmarshal
(
body
,
&
claims
);
err
!=
nil
{
...
...
plugin/scheduler/scheduler.go
View file @
f66c7500
...
...
@@ -153,9 +153,11 @@ func (s *Scheduler) runJobWithSchedule(ctx context.Context, rj *registeredJob, s
_
=
err
}
case
<-
ctx
.
Done
()
:
// Stop the timer to prevent it from firing. The timer will be garbage collected.
timer
.
Stop
()
return
case
<-
s
.
stopCh
:
// Stop the timer to prevent it from firing. The timer will be garbage collected.
timer
.
Stop
()
return
}
...
...
plugin/webhook/webhook.go
View file @
f66c7500
...
...
@@ -49,12 +49,12 @@ func Post(requestPayload *WebhookRequestPayload) error {
if
err
!=
nil
{
return
errors
.
Wrapf
(
err
,
"failed to post webhook to %s"
,
requestPayload
.
URL
)
}
defer
resp
.
Body
.
Close
()
b
,
err
:=
io
.
ReadAll
(
resp
.
Body
)
if
err
!=
nil
{
return
errors
.
Wrapf
(
err
,
"failed to read webhook response from %s"
,
requestPayload
.
URL
)
}
defer
resp
.
Body
.
Close
()
if
resp
.
StatusCode
<
200
||
resp
.
StatusCode
>
299
{
return
errors
.
Errorf
(
"failed to post webhook %s, status code: %d, response body: %s"
,
requestPayload
.
URL
,
resp
.
StatusCode
,
b
)
...
...
server/router/api/v1/attachment_service.go
View file @
f66c7500
...
...
@@ -317,11 +317,6 @@ func SaveAttachmentBlob(ctx context.Context, profile *profile.Profile, stores *s
if
err
=
os
.
MkdirAll
(
dir
,
os
.
ModePerm
);
err
!=
nil
{
return
errors
.
Wrap
(
err
,
"Failed to create directory"
)
}
dst
,
err
:=
os
.
Create
(
osPath
)
if
err
!=
nil
{
return
errors
.
Wrap
(
err
,
"Failed to create file"
)
}
defer
dst
.
Close
()
// Write the blob to the file.
if
err
:=
os
.
WriteFile
(
osPath
,
create
.
Blob
,
0644
);
err
!=
nil
{
...
...
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