Skip to content

local function hangs #79

@srchulo

Description

@srchulo

When I follow this example:

// Require and initialize outside of your main handler
const mysql = require('serverless-mysql')({
  config: {
    host     : process.env.ENDPOINT,
    database : process.env.DATABASE,
    user     : process.env.USERNAME,
    password : process.env.PASSWORD
  }
})
 
// Main handler function
exports.handler = async (event, context) => {
  // Run your query
  let results = await mysql.query('SELECT * FROM table')
 
  // Run clean up function
  await mysql.end()
 
  // Return the results
  return results
}

By invoking my function locally:

sls invoke local -f myFunction

results gets returned by the handler, but then it just hangs forever and the sls command never returns (command prompt doesn't come back). I need to hit ctrl c to end it.

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