summaryrefslogtreecommitdiff
path: root/script
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2020-12-15 15:00:36 +0800
committer最萌小汐 <sumneko@hotmail.com>2020-12-15 15:00:36 +0800
commit20ea3b46f4356d9bf14d45bf80f8f47319843323 (patch)
treed9ad38e7b7a68e72ceb5e027c6b05024a8bffec2 /script
parentf3ec5825e3c6a8090a020097e088f26718c316bb (diff)
downloadlua-language-server-20ea3b46f4356d9bf14d45bf80f8f47319843323.zip
update telemetry
Diffstat (limited to 'script')
-rw-r--r--script/service/telemetry.lua13
1 files changed, 10 insertions, 3 deletions
diff --git a/script/service/telemetry.lua b/script/service/telemetry.lua
index d04662b9..08c34314 100644
--- a/script/service/telemetry.lua
+++ b/script/service/telemetry.lua
@@ -12,7 +12,9 @@ if not token then
util.saveFile(tokenPath, token)
end
-local function pushClient(link)
+log.info('Telemetry Token:', token)
+
+local function pushClientInfo(link)
nonil.enable()
local clientName = client.info.clientInfo.name
local clientVersion = client.info.clientInfo.version
@@ -30,7 +32,12 @@ timer.wait(5, function ()
return
end
local link = net.connect('tcp', '119.45.194.183', 11577)
- pushClient(link)
- net.update()
+ pushClientInfo(link)
end)()
+ timer.loop(1, function ()
+ if not config.config.telemetry.enable then
+ return
+ end
+ net.update()
+ end)
end)