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
1fd4fb38
Commit
1fd4fb38
authored
Dec 13, 2024
by
vicotor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update for twitter swarm
parent
6655d06a
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
23 additions
and
14 deletions
+23
-14
api_db.go
api_db.go
+13
-12
main.go
main.go
+10
-0
task.go
task.go
+0
-2
No files found.
api_db.go
View file @
1fd4fb38
...
...
@@ -148,18 +148,19 @@ func CheckTaskExist(userId, taskId, taskType string) (bool, error) {
func
CheckFollowerTaskAndAccountCount
()
(
bool
,
error
)
{
// check follower task count need < available account count.
fc
,
err
:=
FollowerTaskCount
()
if
err
!=
nil
{
return
false
,
err
}
ac
,
err
:=
AvailableAccountCount
()
if
err
!=
nil
{
return
false
,
err
}
return
fc
<
ac
,
nil
return
true
,
nil
//fc, err := FollowerTaskCount()
//if err != nil {
// return false, err
//}
//
//ac, err := AvailableAccountCount()
//
//if err != nil {
// return false, err
//}
//
//return fc < ac, nil
}
func
FollowerTaskCount
()
(
int64
,
error
)
{
...
...
main.go
View file @
1fd4fb38
...
...
@@ -16,9 +16,12 @@ package main
import
(
"code.wuban.net.cn/odysseus/twitter_syncer/acmanager"
"code.wuban.net.cn/odysseus/twitter_syncer/swarm"
"flag"
"fmt"
"github.com/gofiber/swagger"
"log/slog"
"strings"
//"github.com/gofiber/contrib/swagger"
"github.com/gofiber/fiber/v2"
...
...
@@ -27,7 +30,14 @@ import (
_
"code.wuban.net.cn/odysseus/twitter_syncer/docs"
)
var
(
beeFlag
=
flag
.
String
(
"bee"
,
""
,
"initial bees to use fetch follower"
)
)
func
main
()
{
flag
.
Parse
()
bees
:=
strings
.
Split
(
*
beeFlag
,
","
)
swarm
.
InitSwarm
(
bees
)
done
:=
make
(
chan
interface
{})
...
...
task.go
View file @
1fd4fb38
...
...
@@ -87,8 +87,6 @@ func (w *Work) RunJob(t TaskJob) chan<- interface{} {
fiveMinutesTicker
:=
time
.
NewTicker
(
time
.
Minute
*
1
)
halfHourTicker
:=
time
.
NewTicker
(
time
.
Minute
*
30
)
//recordFc := make(map[string]int)
recordFc
:=
make
([]
TimeAndFollowCount
,
0
,
100
)
for
{
...
...
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