// IsSystemReady : Checks hability of the service to execute commands (Only after "edgebox --build" is ran at least once via SSH, or if built for distribution)
funcisSystemReady()bool{
_,err:=os.Stat("/home/system/components/ws")
return!os.IsNotExist(err)
}
// IsDatabaseReady : Checks is it can successfully connect to the task queue db
funcisDatabaseReady()bool{
returnfalse
}
// getNextInstruction : Retrieves next instruction from the database
funcgetNextInstruction()string{
return"Test Instruction Command"
}
funcexecuteInstruction(string)string{
}
funcsystemIterator(){
if!isSystemReady(){
// Wait about 60 seconds before trying again.
log.Printf("System not ready. Next try will be executed in 60 seconds")
time.Sleep(time.Millisecond*time.Duration(60000))
}else{
// Wait about 1 second before resumming operations.
log.Printf("Next instruction will be executed 1 second")