mirror of
https://github.com/fnproject/fn.git
synced 2022-10-28 21:29:17 +03:00
Add idle_timeout to routes API (#603)
* Add inactivity_timeout to routes API Closes: #544 * Fix failing datastore tests * Rename inactivity_timeout to idle_timeout * Update swagger doc * Update hot fn doc * Fix json tags * Add function timeouts docs * Rewording
This commit is contained in:
@@ -23,6 +23,7 @@ const routesTableCreate = `CREATE TABLE IF NOT EXISTS routes (
|
||||
maxc int NOT NULL,
|
||||
memory int NOT NULL,
|
||||
timeout int NOT NULL,
|
||||
idle_timeout int NOT NULL,
|
||||
type varchar(16) NOT NULL,
|
||||
headers text NOT NULL,
|
||||
config text NOT NULL,
|
||||
@@ -39,7 +40,7 @@ const extrasTableCreate = `CREATE TABLE IF NOT EXISTS extras (
|
||||
value varchar(256) NOT NULL
|
||||
);`
|
||||
|
||||
const routeSelector = `SELECT app_name, path, image, format, maxc, memory, type, timeout, headers, config FROM routes`
|
||||
const routeSelector = `SELECT app_name, path, image, format, maxc, memory, type, timeout, idle_timeout, headers, config FROM routes`
|
||||
|
||||
type rowScanner interface {
|
||||
Scan(dest ...interface{}) error
|
||||
@@ -302,10 +303,11 @@ func (ds *MySQLDatastore) InsertRoute(ctx context.Context, route *models.Route)
|
||||
memory,
|
||||
type,
|
||||
timeout,
|
||||
idle_timeout,
|
||||
headers,
|
||||
config
|
||||
)
|
||||
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?);`,
|
||||
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?);`,
|
||||
route.AppName,
|
||||
route.Path,
|
||||
route.Image,
|
||||
@@ -314,6 +316,7 @@ func (ds *MySQLDatastore) InsertRoute(ctx context.Context, route *models.Route)
|
||||
route.Memory,
|
||||
route.Type,
|
||||
route.Timeout,
|
||||
route.IdleTimeout,
|
||||
string(hbyte),
|
||||
string(cbyte),
|
||||
)
|
||||
@@ -359,6 +362,7 @@ func (ds *MySQLDatastore) UpdateRoute(ctx context.Context, newroute *models.Rout
|
||||
memory = ?,
|
||||
type = ?,
|
||||
timeout = ?,
|
||||
idle_timeout = ?,
|
||||
headers = ?,
|
||||
config = ?
|
||||
WHERE app_name = ? AND path = ?;`,
|
||||
@@ -368,6 +372,7 @@ func (ds *MySQLDatastore) UpdateRoute(ctx context.Context, newroute *models.Rout
|
||||
route.Memory,
|
||||
route.Type,
|
||||
route.Timeout,
|
||||
route.IdleTimeout,
|
||||
string(hbyte),
|
||||
string(cbyte),
|
||||
route.AppName,
|
||||
@@ -431,6 +436,7 @@ func scanRoute(scanner rowScanner, route *models.Route) error {
|
||||
&route.Memory,
|
||||
&route.Type,
|
||||
&route.Timeout,
|
||||
&route.IdleTimeout,
|
||||
&headerStr,
|
||||
&configStr,
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user