mirror of
https://github.com/clusterio/clusterio.git
synced 2026-11-18 15:33:12 +09:00
Pre-compile Message validator
Use a script to pre-compile the validator for the Message class to reduce the loading time for ctl by about 40ms.
This commit is contained in:
1 parent
ae542e9501
commit
5eb91be6fb
5 files changed
+36
-2
No files matched your search
@@ -1,5 +1,6 @@
|
||||
// Note: Run compile_validator script after making changes to this file.
|
||||
"use strict";
|
||||
const libSchema = require("../schema");
|
||||
const message_validate = require("./message_validate.js");
|
||||
|
||||
|
||||
/** @memberof module:lib */
|
||||
@@ -851,7 +852,7 @@ Message.jsonSchema = {
|
||||
MessageDisconnect.jsonSchema,
|
||||
],
|
||||
};
|
||||
Message.validate = libSchema.compile(Message.jsonSchema);
|
||||
Message.validate = message_validate;
|
||||
|
||||
/** @memberof module:lib */
|
||||
class PingRequest {
|
||||
|
||||
Reference in new issue
Block a user