@@ -25,6 +25,7 @@ CREATE TABLE IF NOT EXISTS routes (
2525 maxc integer NOT NULL,
2626 memory integer NOT NULL,
2727 timeout integer NOT NULL,
28+ idle_timeout integer NOT NULL,
2829 type character varying(16) NOT NULL,
2930 headers text NOT NULL,
3031 config text NOT NULL,
@@ -41,7 +42,7 @@ const extrasTableCreate = `CREATE TABLE IF NOT EXISTS extras (
4142 value character varying(256) NOT NULL
4243);`
4344
44- const routeSelector = `SELECT app_name, path, image, format, maxc, memory, type, timeout, headers, config FROM routes`
45+ const routeSelector = `SELECT app_name, path, image, format, maxc, memory, type, timeout, idle_timeout, headers, config FROM routes`
4546
4647type rowScanner interface {
4748 Scan (dest ... interface {}) error
@@ -274,10 +275,11 @@ func (ds *PostgresDatastore) InsertRoute(ctx context.Context, route *models.Rout
274275 memory,
275276 type,
276277 timeout,
278+ idle_timeout,
277279 headers,
278280 config
279281 )
280- VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10);` ,
282+ VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11 );` ,
281283 route .AppName ,
282284 route .Path ,
283285 route .Image ,
@@ -286,6 +288,7 @@ func (ds *PostgresDatastore) InsertRoute(ctx context.Context, route *models.Rout
286288 route .Memory ,
287289 route .Type ,
288290 route .Timeout ,
291+ route .IdleTimeout ,
289292 string (hbyte ),
290293 string (cbyte ),
291294 )
@@ -329,8 +332,9 @@ func (ds *PostgresDatastore) UpdateRoute(ctx context.Context, newroute *models.R
329332 memory = $6,
330333 type = $7,
331334 timeout = $8,
332- headers = $9,
333- config = $10
335+ idle_timeout = $9,
336+ headers = $10,
337+ config = $11
334338 WHERE app_name = $1 AND path = $2;` ,
335339 route .AppName ,
336340 route .Path ,
@@ -340,6 +344,7 @@ func (ds *PostgresDatastore) UpdateRoute(ctx context.Context, newroute *models.R
340344 route .Memory ,
341345 route .Type ,
342346 route .Timeout ,
347+ route .IdleTimeout ,
343348 string (hbyte ),
344349 string (cbyte ),
345350 )
@@ -398,6 +403,7 @@ func scanRoute(scanner rowScanner, route *models.Route) error {
398403 & route .Memory ,
399404 & route .Type ,
400405 & route .Timeout ,
406+ & route .IdleTimeout ,
401407 & headerStr ,
402408 & configStr ,
403409 )
0 commit comments