在尝试在GCP App Engine任务队列中安排任务时出现了InvalidTaskNameError错误。

huangapple go评论69阅读模式
英文:

InvalidTaskNameError while trying to schedule a task in a GCP App Engine taskqueue

问题

我正在尝试使用Google的任务队列包"google.golang.org/appengine/taskqueue"在GCP App Engine中安排一个任务,但是遇到了以下错误:

API错误5(taskqueue: INVALID_TASK_NAME)

我的任务名称是一个字符串:

name:= fmt.Sprintf("%s-trigger-message-%d-%s-%s", env.GetVersion(), userKey.IntID(), profileID, scheduledTime.Format("2006-01-02-15-04"))

请问你能帮忙看看我哪里出错了吗?在网上找不到太多相关的参考资料。

英文:

I am trying to schedule a task in a taskqueue in GCP App engine using googles taskqueue package "google.golang.org/appengine/taskqueue" but getting the below error

API error 5 (taskqueue: INVALID_TASK_NAME)

The name of my task is a string

name:= fmt.Sprintf("%s-trigger-message-%d-%s-%s", env.GetVersion(), userKey.IntID(), profileID, scheduledTime.Format("2006-01-02-15-04"))

Can you please help , where i am doing a mistake . Not getting much references online.

答案1

得分: 1

根据文档,以下是关于有效任务名称的规则:

  1. 任务名称的最大长度应为500个字符。
  2. 名称可以包含大写和小写字母。
  3. 可以包含数字[0-9]。
  4. 可以包含特殊符号如下划线和连字符。
  5. 任务名称的模式应与表达式^[a-zA-Z0-9_-]{1,500}$匹配。
英文:

As per the documentation , Followings are the rules defined for the valid task name:

  1. Maximum length for the task name should be 500 characters.
  2. The name can contain both uppercase and lowercase letters.
  3. Can contain numbers[0-9].
  4. Special symbols like underscores, and hyphens.
  5. Task name Pattern should match with expression : ^[a-zA-Z0-9_-]{1,500}$

huangapple
  • 本文由 发表于 2021年6月17日 18:20:21
  • 转载请务必保留本文链接:https://go.coder-hub.com/68017391.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定