Skip to content
Snippets Groups Projects
Verified Commit d09b3806 authored by zycromerz's avatar zycromerz
Browse files

update DoDropCache method


Signed-off-by: default avatarZyCromerZ <neetroid97@gmail.com>
parent 276f5429
Branches
No related tags found
No related merge requests found
......@@ -573,10 +573,6 @@ DoDropCache(){
local DoDropCacheNow=""
local clearType=""
[[ "$(GetDisplayStatus)" == "off" ]] && [[ "$DropValTime" -le "20" ]] && DropValTime="$(($DropValTime*2))"
if [[ "$(date +"%H")" == "23" ]];then
DropVal="0"
[[ ! -z "$LastDropCache" ]] && LastDropCache=""
else
if [[ -f /proc/sys/vm/drop_caches ]] && [[ "$DropVal" != "0" ]];then
if [[ -z "$LastDropCache" ]];then
DoDropCacheNow="y"
......@@ -585,6 +581,9 @@ DoDropCache(){
else
DoDropCacheNow="n"
fi
[[ "$(echo $LastDropCache | head -c2 )" == "00" ]] && [[ "$(date +"%H")" == "23" ]] && DoDropCacheNow="n"
if [[ "$DropVal" -gt "3" ]];then
DropVal="3"
WriteOnly $DropVal $PMConfig/drop_caches.conf
......@@ -593,6 +592,7 @@ DoDropCache(){
WriteOnly $DropVal $PMConfig/drop_caches.conf
DoDropCacheNow="n"
fi
if [[ "$DoDropCacheNow" == "y" ]];then
# 1 = clear pageCache only.
# 2 = clear dentries and inodes.
......@@ -605,7 +605,6 @@ DoDropCache(){
SendLogs "clear ram $clearType success, will be triggered again at $(AddTime "$DropValTime" proper)"
fi
fi
fi
GetErrorMsg "DoDropCache"
} 2>>$RLOGsE
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment