File tree Expand file tree Collapse file tree 11 files changed +99
-44
lines changed
Expand file tree Collapse file tree 11 files changed +99
-44
lines changed Original file line number Diff line number Diff line change @@ -27,10 +27,15 @@ if wp cache &>/dev/null; then
2727 echo " wp cache command is available"
2828
2929 # Run wp cache flush command
30- echo " Flushing cache..."
31- if ! wp cache flush; then
32- echo " Failed to flush cache" >&2
33- exit 1
30+ if [ " ${SKIP_CACHE_FLUSH:- false} " = " true" ]; then
31+ echo " ⚡ SKIP_CACHE_FLUSH est actif : On conserve le cache existant (Mode High-Traffic)."
32+ else
33+ echo " Flushing cache..."
34+ if ! wp cache flush; then
35+ echo " Failed to flush cache" >&2
36+ # On ne quitte pas forcément en erreur ici, car si Redis est down, le site peut quand même marcher
37+ # exit 1
38+ fi
3439 fi
3540else
3641 echo " project is not using cache or cache is not installed... skipping cache commands."
Original file line number Diff line number Diff line change @@ -27,10 +27,15 @@ if wp cache &>/dev/null; then
2727 echo " wp cache command is available"
2828
2929 # Run wp cache flush command
30- echo " Flushing cache..."
31- if ! wp cache flush; then
32- echo " Failed to flush cache" >&2
33- exit 1
30+ if [ " ${SKIP_CACHE_FLUSH:- false} " = " true" ]; then
31+ echo " ⚡ SKIP_CACHE_FLUSH est actif : On conserve le cache existant (Mode High-Traffic)."
32+ else
33+ echo " Flushing cache..."
34+ if ! wp cache flush; then
35+ echo " Failed to flush cache" >&2
36+ # On ne quitte pas forcément en erreur ici, car si Redis est down, le site peut quand même marcher
37+ # exit 1
38+ fi
3439 fi
3540else
3641 echo " project is not using cache or cache is not installed... skipping cache commands."
Original file line number Diff line number Diff line change @@ -27,10 +27,15 @@ if wp cache &>/dev/null; then
2727 echo " wp cache command is available"
2828
2929 # Run wp cache flush command
30- echo " Flushing cache..."
31- if ! wp cache flush; then
32- echo " Failed to flush cache" >&2
33- exit 1
30+ if [ " ${SKIP_CACHE_FLUSH:- false} " = " true" ]; then
31+ echo " ⚡ SKIP_CACHE_FLUSH est actif : On conserve le cache existant (Mode High-Traffic)."
32+ else
33+ echo " Flushing cache..."
34+ if ! wp cache flush; then
35+ echo " Failed to flush cache" >&2
36+ # On ne quitte pas forcément en erreur ici, car si Redis est down, le site peut quand même marcher
37+ # exit 1
38+ fi
3439 fi
3540else
3641 echo " project is not using cache or cache is not installed... skipping cache commands."
Original file line number Diff line number Diff line change @@ -27,10 +27,15 @@ if wp cache &>/dev/null; then
2727 echo " wp cache command is available"
2828
2929 # Run wp cache flush command
30- echo " Flushing cache..."
31- if ! wp cache flush; then
32- echo " Failed to flush cache" >&2
33- exit 1
30+ if [ " ${SKIP_CACHE_FLUSH:- false} " = " true" ]; then
31+ echo " ⚡ SKIP_CACHE_FLUSH est actif : On conserve le cache existant (Mode High-Traffic)."
32+ else
33+ echo " Flushing cache..."
34+ if ! wp cache flush; then
35+ echo " Failed to flush cache" >&2
36+ # On ne quitte pas forcément en erreur ici, car si Redis est down, le site peut quand même marcher
37+ # exit 1
38+ fi
3439 fi
3540else
3641 echo " project is not using cache or cache is not installed... skipping cache commands."
Original file line number Diff line number Diff line change @@ -27,10 +27,15 @@ if wp cache &>/dev/null; then
2727 echo " wp cache command is available"
2828
2929 # Run wp cache flush command
30- echo " Flushing cache..."
31- if ! wp cache flush; then
32- echo " Failed to flush cache" >&2
33- exit 1
30+ if [ " ${SKIP_CACHE_FLUSH:- false} " = " true" ]; then
31+ echo " ⚡ SKIP_CACHE_FLUSH est actif : On conserve le cache existant (Mode High-Traffic)."
32+ else
33+ echo " Flushing cache..."
34+ if ! wp cache flush; then
35+ echo " Failed to flush cache" >&2
36+ # On ne quitte pas forcément en erreur ici, car si Redis est down, le site peut quand même marcher
37+ # exit 1
38+ fi
3439 fi
3540else
3641 echo " project is not using cache or cache is not installed... skipping cache commands."
Original file line number Diff line number Diff line change @@ -27,10 +27,15 @@ if wp cache &>/dev/null; then
2727 echo " wp cache command is available"
2828
2929 # Run wp cache flush command
30- echo " Flushing cache..."
31- if ! wp cache flush; then
32- echo " Failed to flush cache" >&2
33- exit 1
30+ if [ " ${SKIP_CACHE_FLUSH:- false} " = " true" ]; then
31+ echo " ⚡ SKIP_CACHE_FLUSH est actif : On conserve le cache existant (Mode High-Traffic)."
32+ else
33+ echo " Flushing cache..."
34+ if ! wp cache flush; then
35+ echo " Failed to flush cache" >&2
36+ # On ne quitte pas forcément en erreur ici, car si Redis est down, le site peut quand même marcher
37+ # exit 1
38+ fi
3439 fi
3540else
3641 echo " project is not using cache or cache is not installed... skipping cache commands."
Original file line number Diff line number Diff line change @@ -27,10 +27,15 @@ if wp cache &>/dev/null; then
2727 echo " wp cache command is available"
2828
2929 # Run wp cache flush command
30- echo " Flushing cache..."
31- if ! wp cache flush; then
32- echo " Failed to flush cache" >&2
33- exit 1
30+ if [ " ${SKIP_CACHE_FLUSH:- false} " = " true" ]; then
31+ echo " ⚡ SKIP_CACHE_FLUSH est actif : On conserve le cache existant (Mode High-Traffic)."
32+ else
33+ echo " Flushing cache..."
34+ if ! wp cache flush; then
35+ echo " Failed to flush cache" >&2
36+ # On ne quitte pas forcément en erreur ici, car si Redis est down, le site peut quand même marcher
37+ # exit 1
38+ fi
3439 fi
3540else
3641 echo " project is not using cache or cache is not installed... skipping cache commands."
Original file line number Diff line number Diff line change @@ -27,10 +27,15 @@ if wp cache &>/dev/null; then
2727 echo " wp cache command is available"
2828
2929 # Run wp cache flush command
30- echo " Flushing cache..."
31- if ! wp cache flush; then
32- echo " Failed to flush cache" >&2
33- exit 1
30+ if [ " ${SKIP_CACHE_FLUSH:- false} " = " true" ]; then
31+ echo " ⚡ SKIP_CACHE_FLUSH est actif : On conserve le cache existant (Mode High-Traffic)."
32+ else
33+ echo " Flushing cache..."
34+ if ! wp cache flush; then
35+ echo " Failed to flush cache" >&2
36+ # On ne quitte pas forcément en erreur ici, car si Redis est down, le site peut quand même marcher
37+ # exit 1
38+ fi
3439 fi
3540else
3641 echo " project is not using cache or cache is not installed... skipping cache commands."
Original file line number Diff line number Diff line change @@ -27,10 +27,15 @@ if wp cache &>/dev/null; then
2727 echo " wp cache command is available"
2828
2929 # Run wp cache flush command
30- echo " Flushing cache..."
31- if ! wp cache flush; then
32- echo " Failed to flush cache" >&2
33- exit 1
30+ if [ " ${SKIP_CACHE_FLUSH:- false} " = " true" ]; then
31+ echo " ⚡ SKIP_CACHE_FLUSH est actif : On conserve le cache existant (Mode High-Traffic)."
32+ else
33+ echo " Flushing cache..."
34+ if ! wp cache flush; then
35+ echo " Failed to flush cache" >&2
36+ # On ne quitte pas forcément en erreur ici, car si Redis est down, le site peut quand même marcher
37+ # exit 1
38+ fi
3439 fi
3540else
3641 echo " project is not using cache or cache is not installed... skipping cache commands."
Original file line number Diff line number Diff line change @@ -27,10 +27,15 @@ if wp cache &>/dev/null; then
2727 echo " wp cache command is available"
2828
2929 # Run wp cache flush command
30- echo " Flushing cache..."
31- if ! wp cache flush; then
32- echo " Failed to flush cache" >&2
33- exit 1
30+ if [ " ${SKIP_CACHE_FLUSH:- false} " = " true" ]; then
31+ echo " ⚡ SKIP_CACHE_FLUSH est actif : On conserve le cache existant (Mode High-Traffic)."
32+ else
33+ echo " Flushing cache..."
34+ if ! wp cache flush; then
35+ echo " Failed to flush cache" >&2
36+ # On ne quitte pas forcément en erreur ici, car si Redis est down, le site peut quand même marcher
37+ # exit 1
38+ fi
3439 fi
3540else
3641 echo " project is not using cache or cache is not installed... skipping cache commands."
You can’t perform that action at this time.
0 commit comments