V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
ligz
V2EX  ›  程序员

白嫖 GitHub 失败,用 action 定时循环发消息到企业微信延时太严重!

  •  
  •   ligz · 2022-09-28 09:49:02 +08:00 · 1905 次点击
    这是一个创建于 547 天前的主题,其中的信息可能已经有所发展或是发生改变。

    仓库地址: https://github.com/guangzhengli/wecom-notification-action

    这个仓库 中,我将企业微信机器人发送消息改造成一个 GitHub action ,想实现一个定时循环发送消息的功能,帮助我每天发送不同的消息到企业微信中,提醒组内的小伙伴主持会议,这个方案实现了,也没有问题。但是没想到 GitHub action 的延迟特别严重,我定时 UTC 00:00 ,在 UTC+8 的时区 10:24AM 才触发。。。

    白嫖方案感觉直接失败,不知道各位大佬有没有好点子。

    jimyag
        1
    jimyag  
       2022-09-28 09:53:14 +08:00
    jimyag
        2
    jimyag  
       2022-09-28 09:54:50 +08:00
    @jimyag cf 中有一个 corn 定时器,可以尝试一下
    ligz
        3
    ligz  
    OP
       2022-09-28 10:05:03 +08:00
    @jimyag worker 很强,但是貌似无法多人协同管理内容,不过白嫖也要求不了那么多[doge]
    lisongeee
        4
    lisongeee  
       2022-09-28 10:10:32 +08:00
    GitHub action 的定时触发器根本不准,但是 github 提供了 api 让你可以手动触发

    我现在是用 阿里云的函数计算去定时手动触发 GitHub action
    janus77
        6
    janus77  
       2022-09-28 10:44:38 +08:00
    这种用法不是违规的吗
    zhuweiyou
        7
    zhuweiyou  
       2022-09-28 10:54:40 +08:00
    阿里云 云函数 有免费额度
    ericgui
        8
    ericgui  
       2022-09-28 10:59:48 +08:00
    github actions 自己都不推荐你把 cron 用于生产,他们自己都放弃治疗了
    ligz
        9
    ligz  
    OP
       2022-09-28 11:04:37 +08:00
    @janus77 哪个条款不建议这么做吗,主要我看类似的 action 一大堆,我 GitHub profile README 也是用类似的 action 做的。
    ligz
        10
    ligz  
    OP
       2022-09-28 11:04:53 +08:00
    @lisongeee 这也是条路子
    GreatAuk
        11
    GreatAuk  
       2022-09-28 11:06:23 +08:00
    我有一个 action 定的是每小时,每个小时确实会触发 ,但不一定是小时内的哪分钟...
    ligz
        12
    ligz  
    OP
       2022-09-28 11:11:27 +08:00
    @GreatAuk 其实一个小时内,我也不是不能接受,这相差 2 个多小时,有点离谱
    cweijan
        13
    cweijan  
       2022-09-28 11:14:07 +08:00
    用 github action 做 cron, 白嫖到这份上挺丢人的
    duzhor
        14
    duzhor  
       2022-09-28 11:30:21 +08:00
    你这白票的有点离谱,建议用华为云函数定时触发
    ligz
        15
    ligz  
    OP
       2022-09-28 11:39:40 +08:00
    @cweijan 现在论坛戾气这么重吗,我只想讨论一个技术方案,不知道哪里冒犯到你了
    liuguang
        16
    liuguang  
       2022-09-28 11:47:32 +08:00
    你这样是滥用,小心被 GitHub 封禁 Action 功能
    2123123
        17
    2123123  
       2022-09-28 17:08:27 +08:00
    确实是有条款规定的
    https://docs.github.com/en/site-policy/github-terms/github-terms-for-additional-products-and-features#actions
    其中:
    if using GitHub-hosted runners, any other activity unrelated to the production, testing, deployment, or publication of the software project associated with the repository where GitHub Actions are used.
    像一些签到脚本被 ban 的几率也很大,建议使用阿里云函数计算
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   1063 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 28ms · UTC 19:07 · PVG 03:07 · LAX 12:07 · JFK 15:07
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.