question

Dylan Hunt avatar image
Dylan Hunt asked

Tried to create a task, but "No functions available in CloudScript revision"

I have

function CheckIsAPIOnline(){}

that checks if our API is online. If it says there's no functions available, does that mean there's a syntax error? Is there a way to better test CloudScript?

EDIT: I tried just a simple function:

function ping()
{    
    log.debug("Pong");
    var response = "Pong";
    return { responseContent: response }
}

and commented out the other function. Still can't create a task :/

CloudScript
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

·
brendan avatar image
brendan answered

That sounds like an error in the wording of the Task error message. When calling into Cloud Script from a client API call, a PlayStream action trigger, or a task, what you're calling are handlers. So if you define the function as:

handlers.ping = function (args, context) {
    log.debug("Pong");
    var response = "Pong";
    return { responseContent: response }
}

That'll allow you to select it in the task definition.

4 comments
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Dylan Hunt avatar image Dylan Hunt commented ·

Hmm, I ended up with a generic error:

0 Likes 0 ·
pingpong.jpg (162.5 KiB)
brendan avatar image brendan ♦♦ Dylan Hunt commented ·

We have a fix for this checked in, which we'll be deploying shortly. I'll update when it's ready.

0 Likes 0 ·
Dylan Hunt avatar image Dylan Hunt brendan ♦♦ commented ·

Ah no rush, I'm mostly trying to just test things a bit to make sure I have the core understanding :)

0 Likes 0 ·
brendan avatar image brendan ♦♦ commented ·

The issue blocking the Tasks has now been fixed - sorry for the delay!

0 Likes 0 ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.