mirror of
https://github.com/varunsridharan/github-gitea-mirror.git
synced 2024-09-11 17:56:39 +03:00
Added Option to sleep for 5 seconds after 50 loops
This commit is contained in:
parent
0f8e13b756
commit
65d341e44a
@ -3,14 +3,17 @@
|
|||||||
from helper import log,getConfig,giteaSetRepoTopics,giteaSession,giteaSetRepoStar,giteaCreateRepo,ghApi,giteaCreateUserOrOrg,giteaGetUser,config
|
from helper import log,getConfig,giteaSetRepoTopics,giteaSession,giteaSetRepoStar,giteaCreateRepo,ghApi,giteaCreateUserOrOrg,giteaGetUser,config
|
||||||
from github import GithubException
|
from github import GithubException
|
||||||
from localCacheHelper import giteaExistsRepos,saveLocalCache
|
from localCacheHelper import giteaExistsRepos,saveLocalCache
|
||||||
|
import time
|
||||||
|
|
||||||
def repositoryStared():
|
def repositoryStared():
|
||||||
config = getConfig()
|
config = getConfig()
|
||||||
repo_map = config['repomap']
|
repo_map = config['repomap']
|
||||||
session = giteaSession()
|
session = giteaSession()
|
||||||
gh = ghApi()
|
gh = ghApi()
|
||||||
|
loop_count = 0
|
||||||
|
|
||||||
for repo in gh.get_user().get_starred():
|
for repo in gh.get_user().get_starred():
|
||||||
|
loop_count = loop_count + 1
|
||||||
real_repo = repo.full_name.split('/')[1]
|
real_repo = repo.full_name.split('/')[1]
|
||||||
gitea_dest_user = repo.owner.login
|
gitea_dest_user = repo.owner.login
|
||||||
repo_owner=repo.owner.login
|
repo_owner=repo.owner.login
|
||||||
@ -52,5 +55,11 @@ def repositoryStared():
|
|||||||
else:
|
else:
|
||||||
log(repo)
|
log(repo)
|
||||||
|
|
||||||
|
if loop_count % 50 == 0:
|
||||||
|
log(False)
|
||||||
|
log('Time To Sleep For 5 Seconds')
|
||||||
|
log(False)
|
||||||
|
time.sleep(5)
|
||||||
|
else:
|
||||||
log(False)
|
log(False)
|
||||||
saveLocalCache()
|
saveLocalCache()
|
Loading…
Reference in New Issue
Block a user