Ignore:
File:
1 edited

Legend:

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

    r1ba85cf r0662b2d  
    3636                if($handle === false){
    3737                        $message = "Could not create file (". $config->shutdownRequestFile() .") to indicate shutdown to the daemon.";
    38                         if($debug > 0)
    39                                 echo $message;
    40                         error_log($message);
    41                         $result["shutdownstart"] = -1;
    42                         $result["errormessage"] = $message;
    43                 }
    44                 else{
    45                         $shutdownTime = new \DateTime('NOW');
    46                         $shutdownTime->modify("+15 seconds");
    47                         fwrite($handle, $shutdownTime->format(\DateTime::ATOM));
    48                         $result["shutdownstart"] = $shutdownTime->format(\DateTime::ATOM);
     38                        return $this->error($message, ["shutdownstart" => -1]);
    4939                }
    5040
    51                 header('Content-Type: application/json');
    52                 if($debug > 0){
    53                         echo json_encode($result,  JSON_PRETTY_PRINT) ."\n";
    54                 }
    55                 else{
    56                         echo json_encode($result) ."\n";
    57                 }
     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);
    5847        }
    5948}
Note: See TracChangeset for help on using the changeset viewer.