GCP云函数双函数调用

GCP cloud function double function call

我在 Cloud Function 中创建并执行了与此类似的代码。

但是,在 gcp 中,列表不包含任何值。

是这样吗? 如果您能告诉我是否有相关的文档地址,我将不胜感激。

Google 的 Cloud Functions 以代码中提供的函数作为入口点。我使用 test1 函数作为入口点并从那里调用 test2 函数。

X = []

def test2 ():

  global X
  X.append(2)

def test1 (self):

  global X
  X.append(1)
  test2()
  print(X)

这将 return 日志中 X 的值。