2016-11-29 2 views
0

私はこのアプリケーションをブルーミックスで実行しますが、これは実行するだけです。アプリが終了すると、Bluemixはそれが失敗したと判断し、再度実行します。数回のクラッシュの後で停止します。Bluemix Python Appがクラッシュしてから再び実行されます

これはアプリです。

import os 
import json 
from os.path import join, dirname 
from os import environ 
from watson_developer_cloud import VisualRecognitionV3 
import time 
start_time = time.time() 

visual_recognition = VisualRecognitionV3(VisualRecognitionV3.latest_version, api_key='*******************') 

with open(join(dirname(__file__), './test168.jpg'), 'rb') as image_file: 
print(json.dumps(visual_recognition.classify(images_file=image_file, threshold=0, classifier_ids=['***************']), indent=2)) 

print("--- %s seconds ---" % (time.time() - start_time)) 

私はそれが失敗したと思うことなくアプリを終了することができますどのような方法で、それを繰り返しますか?

+1

[OpenWhisk](https://console.ng.bluemix.net/openwhisk/)の代わりにOpenStackののあなたのような短命ステートレスアプリケーションのためのより良いBluemixプラットフォーム、かもしれません。 – mustaccio

+0

@mustaccioありがとう、病気をチェックしてください。 –

答えて

0

--no-routeフラグを使用してアプリケーションをプッシュすると、ヘルスチェックが無効になり、再起動されます。

cf push myapp --no-route 
+0

私はすでにmanifest.ymlに指定して、set-health-checkコマンドを使用しました。 cf set-health-check appnameなし –

関連する問題