forked from M-Labs/artiq
client: add --async option to scan-repository, recommend usage in git post-receive
This commit is contained in:
parent
7453d85d5e
commit
3efb841557
@ -96,6 +96,8 @@ def get_argparser():
|
||||
|
||||
parser_scan_repos = subparsers.add_parser(
|
||||
"scan-repository", help="trigger a repository (re)scan")
|
||||
parser_scan_repos.add_argument("--async", action="store_true",
|
||||
help="trigger scan and return immediately")
|
||||
parser_scan_repos.add_argument("revision", default=None, nargs="?",
|
||||
help="use a specific repository revision "
|
||||
"(defaults to head)")
|
||||
@ -159,7 +161,10 @@ def _action_scan_devices(remote, args):
|
||||
|
||||
|
||||
def _action_scan_repository(remote, args):
|
||||
remote.scan_repository(args.revision)
|
||||
if args.async:
|
||||
remote.scan_repository_async(args.revision)
|
||||
else:
|
||||
remote.scan_repository(args.revision)
|
||||
|
||||
|
||||
def _action_ls(remote, args):
|
||||
|
@ -93,7 +93,7 @@ There should be no errors displayed, and if you start the GUI again you should n
|
||||
First, another small configuration step is needed. We must tell Git to make the master rescan the repository when new data is added to it. Create a file ``~/artiq-master/repository/hooks/post-receive`` with the following contents: ::
|
||||
|
||||
#!/bin/sh
|
||||
artiq_client scan-repository
|
||||
artiq_client scan-repository --async
|
||||
|
||||
Then set the execution permission on it: ::
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user