Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
scheduler
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
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
Odysseus
scheduler
Commits
389f14c3
Commit
389f14c3
authored
May 27, 2024
by
vicotor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update scheduler
parent
4b3eff99
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
27 additions
and
22 deletions
+27
-22
config.toml
config.toml
+1
-0
Config.go
config/Config.go
+1
-0
backend.go
server/apibackend/backend.go
+0
-16
nmstatus.go
server/nmstatus.go
+0
-1
workerpoper.go
workerpoper/workerpoper.go
+25
-5
No files found.
config.toml
View file @
389f14c3
...
...
@@ -2,6 +2,7 @@ metrics_port = 28012
routines
=
1
max_nm_update_ex
=
40
dispatch_timeout
=
3
poper_version
=
"v1"
[mongodb]
url
=
"mongodb://127.0.0.1:27017"
...
...
config/Config.go
View file @
389f14c3
...
...
@@ -37,6 +37,7 @@ type Config struct {
Routines
int
`json:"routines" toml:"routines"`
MaxNmUpdateEx
int
`json:"max_nm_update_ex" toml:"max_nm_update_ex"`
DispatchTimeout
int
`json:"dispatch_timeout" toml:"dispatch_timeout"`
PoperVersion
string
`json:"poper_version" toml:"poper_version`
Redis
RedisConfig
`json:"redis" toml:"redis"`
Kafka
KafkaConfig
`json:"kafka" toml:"kafka"`
DbConfig
MysqlConfig
`json:"mysql" toml:"mysql"`
...
...
server/apibackend/backend.go
deleted
100644 → 0
View file @
4b3eff99
package
apibackend
type
Backend
interface
{
BloomStatus
()
(
uint64
,
uint64
)
}
type
nodeBackend
struct
{
}
func
(
b
*
nodeBackend
)
BloomStatus
()
(
uint64
,
uint64
)
{
return
0
,
0
}
func
NewBackend
()
Backend
{
return
&
nodeBackend
{}
}
server/nmstatus.go
deleted
100644 → 0
View file @
4b3eff99
package
server
workerpoper/workerpoper.go
View file @
389f14c3
...
...
@@ -4,6 +4,7 @@ import (
"context"
"errors"
odysseus
"github.com/odysseus/odysseus-protocol/gen/proto/go/base/v1"
"github.com/odysseus/scheduler/config"
"github.com/odysseus/scheduler/types"
"github.com/redis/go-redis/v9"
log
"github.com/sirupsen/logrus"
...
...
@@ -21,10 +22,29 @@ type WorkerPoper interface {
}
func
NewPopWorker
()
WorkerPoper
{
v2
,
err
:=
newPoperV2
()
if
err
!=
nil
{
log
.
WithField
(
"err"
,
err
)
.
Error
(
"failed to create poperV2"
)
return
nil
switch
config
.
GetConfig
()
.
PoperVersion
{
case
"v1"
:
v1
,
err
:=
newPoperV1
()
if
err
!=
nil
{
log
.
WithFields
(
log
.
Fields
{
"version"
:
"v1"
,
"err"
:
err
,
})
.
Error
(
"failed to create poper"
)
return
nil
}
return
v1
case
"v2"
:
v2
,
err
:=
newPoperV2
()
if
err
!=
nil
{
log
.
WithFields
(
log
.
Fields
{
"version"
:
"v2"
,
"err"
:
err
,
})
.
Error
(
"failed to create poper"
)
return
nil
}
return
v2
default
:
log
.
WithField
(
"version"
,
config
.
GetConfig
()
.
PoperVersion
)
.
Error
(
"unknown poper version"
)
}
return
v2
return
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