Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
N
network
Manage
Activity
Members
Labels
Plan
Issues
4
Issue boards
Milestones
Wiki
Code
Merge requests
9
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
funkwhale
network
Commits
9f4b1634
Verified
Commit
9f4b1634
authored
2 years ago
by
Georg Krause
Browse files
Options
Downloads
Patches
Plain Diff
Schedule a job for each domain instead of running all in one
parent
23108a31
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
funkwhale_network/cli.py
+8
-8
8 additions, 8 deletions
funkwhale_network/cli.py
with
8 additions
and
8 deletions
funkwhale_network/cli.py
+
8
−
8
View file @
9f4b1634
...
...
@@ -152,22 +152,22 @@ async def launch_domain_poll(session, domain):
@cli.command
()
@click.argument
(
"
domain
"
,
type
=
str
,
nargs
=-
1
)
@click.argument
(
"
domain
s
"
,
type
=
str
,
nargs
=-
1
)
@async_command
async
def
poll
(
domain
):
async
def
poll
(
domain
s
):
"""
Retrieve and store data for the specified domains.
"""
from
.
import
crawler
,
worker
from
.
import
crawler
if
not
domain
:
click
.
echo
(
"
Polling all domains…
"
)
crawler
=
worker
.
Crawler
()
return
await
crawler
.
poll_all
()
if
not
domain
s
:
async
with
DB
()
as
db
:
domains_db
=
await
db
.
get_all_domains
()
domains
=
[
d
[
"
name
"
]
for
d
in
domains_db
]
kwargs
=
crawler
.
get_session_kwargs
()
async
with
aiohttp
.
ClientSession
(
**
kwargs
)
as
session
:
tasks
=
[
launch_domain_poll
(
session
,
d
)
for
d
in
domain
]
tasks
=
[
launch_domain_poll
(
session
,
d
)
for
d
in
domain
s
]
return
await
asyncio
.
wait
(
tasks
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment