【问题标题】:Bluemix Python App runs then crashes and then runs againBluemix Python App 运行然后崩溃,然后再次运行
【发布时间】:2016-11-29 16:04:40
【问题描述】:

我在 bluemix 上运行这个应用程序,它只需要运行一个。当应用程序退出时,Bluemix 认为它失败了,然后再次运行它。几次崩溃后,它停止了。

这是应用程序。

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))

我有什么方法可以让它退出应用而不认为它会失败并重复自己?

【问题讨论】:

  • 对于像您这样的短期无状态应用程序,OpenWhisk 可能是比 OpenStack 更好的 Bluemix 平台。
  • @mustaccio 谢谢,我去看看。

标签: python ibm-cloud watson visual-recognition


【解决方案1】:

使用--no-route 标志推送应用程序应禁用运行状况检查并重新启动。

cf push myapp --no-route

【讨论】:

  • 我已经在 manifest.yml 中指定了它并使用了 set-health-check 命令。 cf set-health-check appname 无
猜你喜欢
  • 1970-01-01
  • 2022-09-27
  • 1970-01-01
  • 1970-01-01
  • 2022-01-22
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多