Skip to content
This repository was archived by the owner on Apr 23, 2025. It is now read-only.
This repository was archived by the owner on Apr 23, 2025. It is now read-only.

background GCF中使用setTimeout配合pubsub进行重试会导致该GCF超时 #6

@mrdulin

Description

@mrdulin

需求:定时调用GCF

思路1:在GCF中使用setTimeout作为定时器,使用google pubsub再次publish消息到触发该GCFTOPIC

当设置GCF的超时时间为10秒,通过环境变量指定setTimeout的时间为15秒,会导致GCF超时。

image

GCF超时日志:

image

还有一个问题是,在GCF中使用setTimeout会导致该GCF一直处在执行过程中,这样会导致费用上升,因为GCF的是根据调用次数和执行时间来收费的。

参考:

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions