Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
T
twitter_syncer
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
twitter_syncer
Commits
3fb16bbc
Commit
3fb16bbc
authored
Mar 31, 2025
by
vicotor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update for syncer
parent
2c242dfa
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
4 deletions
+7
-4
db.go
core/db.go
+1
-1
task.go
core/task.go
+6
-3
No files found.
core/db.go
View file @
3fb16bbc
...
...
@@ -159,7 +159,7 @@ func GetTasks() ([]TaskJob, error) {
Ascending
:
false
,
// NullsFirst bool
// ForeignTable string
})
.
Range
(
0
,
10
,
""
)
.
Execute
()
})
.
Range
(
0
,
10
0
,
""
)
.
Execute
()
if
err
!=
nil
{
slog
.
Error
(
"select * from followers error"
,
err
)
...
...
core/task.go
View file @
3fb16bbc
...
...
@@ -4,6 +4,7 @@ import (
"code.wuban.net.cn/odysseus/twitter_syncer/swarm"
"fmt"
"log/slog"
"math/rand"
"sync"
"time"
)
...
...
@@ -82,10 +83,12 @@ func (w *Work) RunJob(t TaskJob) chan<- interface{} {
if
t
.
TaskType
==
FollowType
{
cli
:=
swarm
.
GetSwarm
()
randomIdx
:=
rand
.
Intn
(
10
)
+
1
randomDelay
:=
time
.
Duration
(
randomIdx
)
*
time
.
Second
secondTicker
:=
time
.
NewTicker
(
time
.
Second
*
20
)
fiveMinutesTicker
:=
time
.
NewTicker
(
time
.
Minute
*
1
)
halfHourTicker
:=
time
.
NewTicker
(
time
.
Minute
*
30
)
secondTicker
:=
time
.
NewTicker
(
time
.
Second
*
20
+
randomDelay
)
fiveMinutesTicker
:=
time
.
NewTicker
(
time
.
Minute
*
1
+
randomDelay
)
halfHourTicker
:=
time
.
NewTicker
(
time
.
Minute
*
30
+
randomDelay
)
first
:=
true
recordFc
:=
make
([]
TimeAndFollowCount
,
0
,
100
)
...
...
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