mirror of
https://github.com/linuxserver/core.git
synced 2026-02-20 05:07:19 +08:00
Add more vfs connection metrics. Make metrics more DRY
This commit is contained in:
parent
17de8dd1d3
commit
9696045ab0
@ -83,6 +83,7 @@ define(function(require, exports, module) {
|
||||
|
||||
smith.debug = DEBUG;
|
||||
|
||||
emit.sticky("connectClient");
|
||||
connection = connectClient(connectEngine, {
|
||||
preConnectCheck: preConnectCheck,
|
||||
debug: DEBUG
|
||||
@ -110,6 +111,7 @@ define(function(require, exports, module) {
|
||||
|
||||
function preConnectCheck(callback) {
|
||||
|
||||
emit.sticky("preConnectCheckStart");
|
||||
vfsEndpoint.isOnline(function(err, isOnline) {
|
||||
if (err || !isOnline) return callback(null, false);
|
||||
|
||||
@ -118,7 +120,7 @@ define(function(require, exports, module) {
|
||||
|
||||
vfsEndpoint.isServerAlive(pingUrl, function(err, isAlive) {
|
||||
if (!err && isAlive) {
|
||||
emit("preConnectChecked");
|
||||
emit("preConnectCheckEnd");
|
||||
return callback(null, true);
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user