GS-run-stop-status


function aaa(){


var status = PropertiesService.getScriptProperties().getProperty('functionStatus');
if (status === 'run') { console.log("status-run"); return; }
ex(0) 

if(anu==ani){
 okeeeee
}else{
  ex(1);
  return;
}





ex(1)//stop jika selesai


//fungsi update status 0=run 1=stop 
function ex(a){
  if(a==0){
    PropertiesService.getScriptProperties().setProperty('functionStatus', 'run');
    console.log("go-run")
  }else{
    PropertiesService.getScriptProperties().setProperty('functionStatus', 'stop');
    console.log("go-stop")
  }

}


}


//catatan, jika ada fungsi return; harus ubah menjadi ex(1); return; biar status jadi stop baru exit