mirror of
https://github.com/clusterio/clusterio.git
synced 2026-11-20 07:43:12 +09:00
Reference by global in statistics_exporter
Store export function in a global table in the lua module for statistics exporter in order to avoid a remote.call.
This commit is contained in:
1 parent
0e9cd35c30
commit
6cf16cc09e
4 files changed
+6
-11
No files matched your search
@@ -16,7 +16,7 @@ describe("statistics_exporter plugin", function() {
|
||||
describe(".onMetrics()", function() {
|
||||
it("should record statistics", async function() {
|
||||
instancePlugin.instance.server.rconCommandResults.set(
|
||||
'/sc remote.call("statistics_exporter", "export")',
|
||||
'/sc statistics_exporter.export()',
|
||||
JSON.stringify({
|
||||
game_tick: 100,
|
||||
player_count: 3,
|
||||
@@ -51,7 +51,7 @@ describe("statistics_exporter plugin", function() {
|
||||
it("should pass on JSON parse errors", async function() {
|
||||
let string = 'An error occured\n';
|
||||
instancePlugin.instance.server.rconCommandResults.set(
|
||||
'/sc remote.call("statistics_exporter", "export")', string
|
||||
'/sc statistics_exporter.export()', string
|
||||
);
|
||||
|
||||
let errorMessage;
|
||||
|
||||
Reference in new issue
Block a user