/adei/trunk

To get this branch, use:
bzr branch http://darksoft.org/webbzr/adei/trunk

« back to all changes in this revision

Viewing changes to scripts/system/cacher.sh

  • Committer: Suren A. Chilingaryan
  • Date: 2018-03-21 16:21:54 UTC
  • Revision ID: csa@suren.me-20180321162154-w138wtbfi1uy8ma3
Various improvements for OpenShift operation

Show diffs side-by-side

added added

removed removed

Lines of Context:
21
21
ADEI_URL=${ADEI_URL:-http://localhost/adei}
22
22
ADEI_PARALLEL=${ADEI_PARALLEL:-sources}
23
23
ADEI_IDLE_SLEEP=${ADEI_IDLE_SLEEP:-5}
 
24
ADEI_ERROR_SLEEP=${ADEI_ERROR_SLEEP:-1}
24
25
 
25
26
if [ -z "$ADEI_SETUP" ]; then
26
27
    ADEI_SETUP=$(cd "$ADEI_PATH"; php  -r 'require "adei.php"; echo $ADEI_SETUP;')
49
50
    elif [[ "$src" =~ ^Error ]]; then
50
51
        echo "$date Error querying scheduler service at $ADEI_SCHEDULER_URL"
51
52
        echo $src
 
53
        sleep "$ADEI_IDLE_SLEEP"
52
54
    elif [ -n "$src" ]; then
53
55
        [[ $src =~ ^([^ ]*)\ (.*)$ ]]
54
56
        name=${BASH_REMATCH[1]}
61
63
                args="$args -multihost -parallel ${ADEI_PARALLEL}"
62
64
                echo "$date Caching \"$name\" with arguments: $args"
63
65
                php "$ADEI_PATH/system/cache.php" $args
64
 
                [ $? -ne 0 ] && sleep "$ADEI_IDLE_SLEEP"
 
66
                [ $? -ne 0 ] && sleep "$ADEI_ERROR_SLEEP"
65
67
            else
66
68
                echo "$date Skipping \"$name\" which is processed by another cacher"
67
69
            fi