Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/webapp/webservice/inc/GnuBoat/ServiceShutdown.php

    r0662b2d r563c04b  
    3636                if($handle === false){
    3737                        $message = "Could not create file (". $config->shutdownRequestFile() .") to indicate shutdown to the daemon.";
    38                         return $this->error($message, ["shutdownstart" => -1]);
     38                        error_log($message);
     39                        $result["shutdownstart"] = -1;
     40                        $result["errormessage"] = $message;
     41                }
     42                else{
     43                        $shutdownTime = new \DateTime('NOW');
     44                        $shutdownTime->modify("+15 seconds");
     45                        fwrite($handle, $shutdownTime->format(\DateTime::ATOM));
     46                        $result["shutdownstart"] = $shutdownTime->format(\DateTime::ATOM);
    3947                }
    4048
    41                 $shutdownTime = new \DateTime('NOW');
    42                 $shutdownTime->modify("+15 seconds");
    43                 fwrite($handle, $shutdownTime->format(\DateTime::ATOM));
    44                 fclose($handle);
    45                 $result["shutdownstart"] = $shutdownTime->format(\DateTime::ATOM);
    46                 $this->output($result);
     49                header('Content-Type: application/json');
     50                if($debug > 0){
     51                        echo json_encode($result,  JSON_PRETTY_PRINT) ."\n";
     52                }
     53                else{
     54                        echo json_encode($result) ."\n";
     55                }
    4756        }
    4857}
Note: See TracChangeset for help on using the changeset viewer.