V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
Ununennium
V2EX  ›  问与答

云函数在服务器执行和在本地执行效果不一致?

  •  
  •   Ununennium · Sep 7, 2020 · 954 views
    This topic created in 2061 days ago, the information mentioned may be changed or developed.

    微信小程序

     exports.main = async (event, context) => {
       db.collection('isRunning').get({
     success:res=>{
       console.log("结果为::::::::"+res.data[0].taskId)
       return res.data[0].taskId
     }
     })
    
    放在本地执行能读取到结果,在云函数执行返回 null,且 console.log("结果为:::)也没有输出。
    
    
    谢谢!
    
    2 replies    2020-09-08 10:54:18 +08:00
    whileFalse
        1
    whileFalse  
       Sep 7, 2020
    确定云函数能直接用 async ?
    Ununennium
        2
    Ununennium  
    OP
       Sep 8, 2020
    @whileFalse 确定,async 是编译器自己生成的,不是我写的
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   2651 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 30ms · UTC 03:14 · PVG 11:14 · LAX 20:14 · JFK 23:14
    ♥ Do have faith in what you're doing.