Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
Oskar Roesler
ros-aur-helpers
Commits
15ae7634
Verified
Commit
15ae7634
authored
Dec 03, 2020
by
Oskar Roesler
Browse files
Add threading at Clone.clone and Pull.pull for now, maybe refactored in the future.
parent
6a86b5af
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
2 deletions
+5
-2
aurci/bootstrap.py
aurci/bootstrap.py
+5
-2
No files found.
aurci/bootstrap.py
View file @
15ae7634
from
git
import
Repo
from
aurci.general
import
Routines
import
os
from
concurrent.futures
import
ThreadPoolExecutor
class
Clone
(
Routines
):
...
...
@@ -13,9 +14,10 @@ class Clone(Routines):
def
clone
(
self
):
if
self
.
package
==
"all"
:
t
=
ThreadPoolExecutor
(
max_workers
=
(
os
.
cpu_count
()))
repos
=
self
.
gh_organization
.
get_repos
(
type
=
"all"
,
sort
=
"full_name"
,
direction
=
"desc"
)
for
repo
in
repos
:
Clone
(
repo
.
name
,
self
.
verbosity
,
self
.
output
).
cloning
(
)
t
.
submit
(
Clone
(
repo
.
name
,
self
.
verbosity
,
self
.
output
).
cloning
)
else
:
self
.
cloning
()
...
...
@@ -24,8 +26,9 @@ class Pull(Routines):
def
pull
(
self
):
if
self
.
package
==
"all"
:
t
=
ThreadPoolExecutor
(
max_workers
=
(
os
.
cpu_count
()))
for
folder
in
os
.
listdir
(
"./packages"
):
Pull
(
folder
,
self
.
verbosity
,
self
.
output
).
pull
(
)
t
.
submit
(
Pull
(
folder
,
self
.
verbosity
,
self
.
output
).
pull
)
else
:
repo
=
Repo
(
path
=
self
.
path
)
repo
.
git
.
stash
()
...
...
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