From 076268201565f85875a757af488b199981c4e07f Mon Sep 17 00:00:00 2001 From: midoks Date: Fri, 8 Jul 2022 20:02:22 +0800 Subject: [PATCH] Update index.py --- plugins/php-apt/index.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/plugins/php-apt/index.py b/plugins/php-apt/index.py index d51416383..579617148 100755 --- a/plugins/php-apt/index.py +++ b/plugins/php-apt/index.py @@ -481,14 +481,16 @@ def getFpmStatus(version): try: sock_data = mw.requestFcgiPHP( sock_file, '/phpfpm_status_apt' + version + '?json') + + result = str(sock_data, encoding='utf-8') + data = json.loads(result) + fTime = time.localtime(int(data['start time'])) + data['start time'] = time.strftime('%Y-%m-%d %H:%M:%S', fTime) except Exception as e: return mw.returnJson(False, str(e)) # print(data) - result = str(sock_data, encoding='utf-8') - data = json.loads(result) - fTime = time.localtime(int(data['start time'])) - data['start time'] = time.strftime('%Y-%m-%d %H:%M:%S', fTime) + return mw.returnJson(True, "OK", data)