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)