src/Pure/Admin/isabelle_cronjob.scala
changeset 65915 49f61e2f5a02
parent 65908 aefdb9e664c9
child 65917 2b7d4678bce6
     1.1 --- a/src/Pure/Admin/isabelle_cronjob.scala	Tue May 23 21:31:33 2017 +0200
     1.2 +++ b/src/Pure/Admin/isabelle_cronjob.scala	Wed May 24 11:17:23 2017 +0200
     1.3 @@ -219,9 +219,8 @@
     1.4            detect = Build_Log.Settings.ML_PLATFORM + " = " + SQL.string("x86_64-windows"))))
     1.5    }
     1.6  
     1.7 -  private def remote_build_history(arg: (String, Int), r: Remote_Build): Logger_Task =
     1.8 +  private def remote_build_history(rev: String, i: Int, r: Remote_Build): Logger_Task =
     1.9    {
    1.10 -    val (rev, index) = arg
    1.11      val task_name = "build_history-" + r.host
    1.12      Logger_Task(task_name, logger =>
    1.13        {
    1.14 @@ -240,7 +239,7 @@
    1.15                    push_isabelle_home = push_isabelle_home,
    1.16                    options =
    1.17                      "-r " + Bash.string(rev) +
    1.18 -                    " -N " + Bash.string(task_name) + "_" + (index + 1).toString +
    1.19 +                    " -N " + Bash.string(task_name) + "_" + (if (i < 0) "" else (i + 1).toString) +
    1.20                      " -f " + r.options,
    1.21                    args = "-o timeout=10800 " + r.args)
    1.22  
    1.23 @@ -402,9 +401,11 @@
    1.24          run_now(
    1.25            SEQ(List(build_release, build_history_base,
    1.26              PAR(remote_builds.map(seq =>
    1.27 -              SEQ(seq.flatMap(r =>
    1.28 -                r.pick(logger.options, rev, r.history_base_filter(hg)).zipWithIndex.
    1.29 -                  map(remote_build_history(_, r)))))),
    1.30 +              SEQ(
    1.31 +                for {
    1.32 +                  (r, i) <- (if (seq.length <= 1) seq.map((_, -1)) else seq.zipWithIndex)
    1.33 +                  rev <- r.pick(logger.options, rev, r.history_base_filter(hg))
    1.34 +                } yield remote_build_history(rev, i, r)))),
    1.35              Logger_Task("jenkins_logs", _ => Jenkins.download_logs(jenkins_jobs, main_dir)),
    1.36              Logger_Task("build_log_database",
    1.37                logger => Isabelle_Devel.build_log_database(logger.options)),