#2 added link to relaunch server on process error page

This commit is contained in:
Alok Saldanha
2019-09-17 11:05:22 -04:00
parent a6d80c1926
commit f7f49b3568
8 changed files with 60 additions and 34 deletions
+3 -1
View File
@@ -6,6 +6,7 @@
# under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES
# OR CONDITIONS OF ANY KIND, either express or implied. See the License for
# the specific language governing permissions and limitations under the License.
import psutil
from flask import make_response, request
from requests import get, post, put
@@ -73,7 +74,8 @@ class CacheEntry:
else:
self.all_output += output
def terminate(self, process):
def terminate(self):
pid = self.pid
if pid != None and self.status != "terminated":
p = psutil.Process(pid)
p.terminate()