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
2a93b8d7
Commit
2a93b8d7
authored
Apr 18, 2024
by
Steven
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
chore: tweak linter
parent
5d967f41
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
6 deletions
+4
-6
main.go
bin/memos/main.go
+1
-5
server.go
server/server.go
+3
-1
No files found.
bin/memos/main.go
View file @
2a93b8d7
...
@@ -12,7 +12,6 @@ import (
...
@@ -12,7 +12,6 @@ import (
"github.com/spf13/cobra"
"github.com/spf13/cobra"
"github.com/spf13/viper"
"github.com/spf13/viper"
"github.com/usememos/memos/internal/jobs"
"github.com/usememos/memos/server"
"github.com/usememos/memos/server"
"github.com/usememos/memos/server/profile"
"github.com/usememos/memos/server/profile"
"github.com/usememos/memos/store"
"github.com/usememos/memos/store"
...
@@ -85,10 +84,7 @@ var (
...
@@ -85,10 +84,7 @@ var (
printGreetings
()
printGreetings
()
// update (pre-sign) object storage links if applicable
if
err
:=
s
.
Start
();
err
!=
nil
{
go
jobs
.
RunPreSignLinks
(
ctx
,
storeInstance
)
if
err
:=
s
.
Start
(
ctx
);
err
!=
nil
{
if
err
!=
http
.
ErrServerClosed
{
if
err
!=
http
.
ErrServerClosed
{
slog
.
Error
(
"failed to start server"
,
err
)
slog
.
Error
(
"failed to start server"
,
err
)
cancel
()
cancel
()
...
...
server/server.go
View file @
2a93b8d7
...
@@ -15,6 +15,7 @@ import (
...
@@ -15,6 +15,7 @@ import (
"github.com/soheilhy/cmux"
"github.com/soheilhy/cmux"
"google.golang.org/grpc"
"google.golang.org/grpc"
"github.com/usememos/memos/internal/jobs"
storepb
"github.com/usememos/memos/proto/gen/store"
storepb
"github.com/usememos/memos/proto/gen/store"
"github.com/usememos/memos/server/profile"
"github.com/usememos/memos/server/profile"
"github.com/usememos/memos/server/route/api/auth"
"github.com/usememos/memos/server/route/api/auth"
...
@@ -103,7 +104,7 @@ func NewServer(ctx context.Context, profile *profile.Profile, store *store.Store
...
@@ -103,7 +104,7 @@ func NewServer(ctx context.Context, profile *profile.Profile, store *store.Store
return
s
,
nil
return
s
,
nil
}
}
func
(
s
*
Server
)
Start
(
ctx
context
.
Context
)
error
{
func
(
s
*
Server
)
Start
()
error
{
address
:=
fmt
.
Sprintf
(
":%d"
,
s
.
Profile
.
Port
)
address
:=
fmt
.
Sprintf
(
":%d"
,
s
.
Profile
.
Port
)
listener
,
err
:=
net
.
Listen
(
"tcp"
,
address
)
listener
,
err
:=
net
.
Listen
(
"tcp"
,
address
)
if
err
!=
nil
{
if
err
!=
nil
{
...
@@ -146,6 +147,7 @@ func (s *Server) Shutdown(ctx context.Context) {
...
@@ -146,6 +147,7 @@ func (s *Server) Shutdown(ctx context.Context) {
}
}
func
(
s
*
Server
)
StartRunners
(
ctx
context
.
Context
)
{
func
(
s
*
Server
)
StartRunners
(
ctx
context
.
Context
)
{
go
jobs
.
RunPreSignLinks
(
ctx
,
s
.
Store
)
go
versionchecker
.
NewVersionChecker
(
s
.
Store
,
s
.
Profile
)
.
Start
(
ctx
)
go
versionchecker
.
NewVersionChecker
(
s
.
Store
,
s
.
Profile
)
.
Start
(
ctx
)
}
}
...
...
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