From 3efb8415571559b9395e8ac20048e08219df03f4 Mon Sep 17 00:00:00 2001 From: Sebastien Bourdeauducq Date: Mon, 4 Apr 2016 22:17:39 +0800 Subject: [PATCH] client: add --async option to scan-repository, recommend usage in git post-receive --- artiq/frontend/artiq_client.py | 7 ++++++- doc/manual/getting_started_mgmt.rst | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/artiq/frontend/artiq_client.py b/artiq/frontend/artiq_client.py index 7e6030148..a34ea876e 100755 --- a/artiq/frontend/artiq_client.py +++ b/artiq/frontend/artiq_client.py @@ -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): diff --git a/doc/manual/getting_started_mgmt.rst b/doc/manual/getting_started_mgmt.rst index d14c75a89..85b881e6e 100644 --- a/doc/manual/getting_started_mgmt.rst +++ b/doc/manual/getting_started_mgmt.rst @@ -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: ::