1
0
mirror of https://github.com/spacebarchat/server.git synced 2024-11-25 11:43:07 +01:00

Fall back to @yukikaze-bot/erlpack if erlpack cant be found or loaded

This commit is contained in:
Emma [it/its]@Rory& 2024-10-09 05:08:37 +02:00
parent 28715f7949
commit 3585e9316e
4 changed files with 24 additions and 9 deletions

View File

@ -5,11 +5,11 @@
"systems": "systems"
},
"locked": {
"lastModified": 1710146030,
"narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=",
"lastModified": 1726560853,
"narHash": "sha256-X6rJYSESBVr3hBoH0WbKE5KvhPU5bloyZ2L4K60/fPQ=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "b1d9ab70662946ef0850d488da1c9019f3a9752a",
"rev": "c1dfcf08411b08f6b8615f7d8971a2bfa81d5e8a",
"type": "github"
},
"original": {
@ -20,11 +20,11 @@
},
"nixpkgs": {
"locked": {
"lastModified": 1723637854,
"narHash": "sha256-med8+5DSWa2UnOqtdICndjDAEjxr5D7zaIiK4pn0Q7c=",
"lastModified": 1728241625,
"narHash": "sha256-yumd4fBc/hi8a9QgA9IT8vlQuLZ2oqhkJXHPKxH/tRw=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "c3aa7b8938b17aebd2deecf7be0636000d62a2b9",
"rev": "c31898adf5a8ed202ce5bea9f347b1c6871f32d1",
"type": "github"
},
"original": {

View File

@ -33,7 +33,12 @@ let erlpack: ErlpackType | null = null;
try {
erlpack = require("erlpack") as ErlpackType;
} catch (e) {
// empty
console.log("Failed to import erlpack: ", e);
try {
erlpack = require("@yukikaze-bot/erlpack") as ErlpackType;
} catch (e) {
console.log("Failed to import @yukikaze-bot/erlpack: ", e);
}
}
// TODO: check rate limit

View File

@ -31,7 +31,12 @@ let erlpack: ErlpackType | null = null;
try {
erlpack = require("erlpack") as ErlpackType;
} catch (e) {
// empty
console.log("Failed to import erlpack: ", e);
try {
erlpack = require("@yukikaze-bot/erlpack") as ErlpackType;
} catch (e) {
console.log("Failed to import @yukikaze-bot/erlpack: ", e);
}
}
export async function Message(this: WebSocket, buffer: WS.Data) {

View File

@ -25,7 +25,12 @@ let erlpack: ErlpackType | null = null;
try {
erlpack = require("erlpack") as ErlpackType;
} catch (e) {
// empty
console.log("Failed to import erlpack: ", e);
try {
erlpack = require("@yukikaze-bot/erlpack") as ErlpackType;
} catch (e) {
console.log("Failed to import @yukikaze-bot/erlpack: ", e);
}
}
// don't care