IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 27072


Ignore:
Timestamp:
Feb 24, 2010, 5:11:11 PM (16 years ago)
Author:
Paul Price
Message:

Automatic reversion of failures.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ippTasks/publish.pro

    r26957 r27072  
    2424    active true
    2525  end
     26  task publish.revert
     27    active true
     28  end
    2629end
    2730
     
    3437  end
    3538  task publish.run
     39    active false
     40  end
     41  task publish.revert
     42    active false
     43  end
     44end
     45
     46
     47macro publish.revert.on
     48  task publish.revert
     49    active true
     50  end
     51end
     52
     53macro publish.revert.off
     54  task publish.revert
    3655    active false
    3756  end
     
    4261$publish_trigger_DB = 0
    4362$publish_load_DB = 0
     63$publish_revert_DB = 0
    4464
    4565task           publish.trigger
     
    201221  end
    202222end
     223
     224
     225task publish.revert
     226  host         local
     227
     228  periods      -poll 5.0
     229  periods      -exec 60.0
     230  periods      -timeout 120.0
     231  npending     1
     232  active false
     233
     234  stdout NULL
     235  stderr $LOGDIR/revert.log
     236
     237  task.exec
     238    if ($LABEL:n == 0) break
     239    $run = pubtool -revert
     240    if ($DB:n == 0)
     241      option DEFAULT
     242    else
     243      # save the DB name for the exit tasks
     244      option $DB:$publish_revert_DB
     245      $run = $run -dbname $DB:$publish_revert_DB
     246      $publish_revert_DB ++
     247      if ($publish_revert_DB >= $DB:n) set publish_revert_DB = 0
     248    end
     249    add_poll_labels run
     250    command $run
     251  end
     252
     253  # success
     254  task.exit    0
     255  end
     256
     257  # locked list
     258  task.exit    default
     259    showcommand failure
     260  end
     261
     262  task.exit    crash
     263    showcommand crash
     264  end
     265
     266  # operation times out?
     267  task.exit    timeout
     268    showcommand timeout
     269  end
     270end
Note: See TracChangeset for help on using the changeset viewer.