mirror of
https://github.com/haiwen/seafile-server.git
synced 2025-09-01 07:26:37 +00:00
A few optimizations for SQL queries related to repos.
- Support paging for listing owned repos - Reduce SQL queries for getting and listing repos.
This commit is contained in:
@@ -375,8 +375,8 @@ class SeafServerThreadedRpcClient(ccnet.RpcClientBase):
|
||||
pass
|
||||
get_orphan_repo_list = seafile_get_orphan_repo_list
|
||||
|
||||
@searpc_func("objlist", ["string", "int"])
|
||||
def seafile_list_owned_repos(user_id, ret_corrupted):
|
||||
@searpc_func("objlist", ["string", "int", "int", "int"])
|
||||
def seafile_list_owned_repos(user_id, ret_corrupted, start, limit):
|
||||
pass
|
||||
list_owned_repos = seafile_list_owned_repos
|
||||
|
||||
|
@@ -107,12 +107,13 @@ class SeafileAPI(object):
|
||||
"""
|
||||
return seafserv_threaded_rpc.get_repo_owner(repo_id)
|
||||
|
||||
def get_owned_repo_list(self, username, ret_corrupted=False):
|
||||
def get_owned_repo_list(self, username, ret_corrupted=False, start=-1, limit=-1):
|
||||
"""
|
||||
Return: a list of Repo objects
|
||||
"""
|
||||
return seafserv_threaded_rpc.list_owned_repos(username,
|
||||
1 if ret_corrupted else 0)
|
||||
1 if ret_corrupted else 0,
|
||||
start, limit)
|
||||
|
||||
def get_orphan_repo_list(self):
|
||||
return seafserv_threaded_rpc.get_orphan_repo_list()
|
||||
|
Reference in New Issue
Block a user