Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
A
augustctl
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
open-source
augustctl
Commits
8c778afd
Verified
Commit
8c778afd
authored
8 years ago
by
Erick Hitter
Browse files
Options
Downloads
Patches
Plain Diff
Restore timeout
parent
832a158b
Branches
master
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
package.json
+1
-0
1 addition, 0 deletions
package.json
server.js
+10
-0
10 additions, 0 deletions
server.js
with
11 additions
and
0 deletions
package.json
+
1
−
0
View file @
8c778afd
...
...
@@ -18,6 +18,7 @@
"
apicache
"
:
"
*
"
,
"
asyncawait
"
:
"
^0.7.4
"
,
"
bluebird
"
:
"
^2.9.34
"
,
"
connect-timeout
"
:
"
*
"
,
"
debug
"
:
"
^2.2.0
"
,
"
express
"
:
"
^4.13.3
"
,
"
morgan
"
:
"
^1.6.1
"
,
...
...
This diff is collapsed.
Click to expand it.
server.js
+
10
−
0
View file @
8c778afd
...
...
@@ -11,6 +11,7 @@ var await = require( 'asyncawait/await' );
var
async
=
require
(
'
asyncawait/async
'
);
var
apicache
=
require
(
'
apicache
'
).
options
(
{
defaultDuration
:
15000
}
);
var
cache
=
apicache
.
middleware
;
var
timeout
=
require
(
'
connect-timeout
'
);
var
request
=
require
(
'
request
'
);
/**
...
...
@@ -26,6 +27,8 @@ var port = serverConfig.port || 3000;
var
app
=
express
();
app
.
use
(
morgan
(
DEBUG
?
'
dev
'
:
'
combined
'
)
);
app
.
use
(
timeout
(
'
10s
'
)
);
app
.
use
(
haltOnTimeout
);
// Parse lock configurations
Object
.
keys
(
config
).
forEach
(
function
(
lockName
)
{
...
...
@@ -84,6 +87,13 @@ function statusStringtoInt( status ) {
return
statusInt
;
}
// Timeout callback
function
haltOnTimeout
(
req
,
res
,
next
)
{
if
(
!
req
.
timedout
)
{
next
();
}
}
/**
* ROUTES
*/
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment