This repository has been archived by the owner on Jan 1, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
v0.2.0: Add getGroup caching, and production build
- Loading branch information
Showing
5 changed files
with
50 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,7 @@ | ||
{ | ||
"name": "cetus-rbx", | ||
"tree": { | ||
"$className": "DataModel", | ||
|
||
"ServerStorage": { | ||
"$className": "ServerStorage", | ||
"$path": "src" | ||
}, | ||
"HttpService": { | ||
"$className": "HttpService", | ||
"$properties": { | ||
"HttpEnabled": true | ||
} | ||
} | ||
"$path": "src" | ||
|
||
} | ||
|
||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
{ | ||
"name": "cetus-rbx", | ||
"tree": { | ||
"$className": "DataModel", | ||
|
||
"ServerStorage": { | ||
"$className": "ServerStorage", | ||
"$path": "src" | ||
}, | ||
"HttpService": { | ||
"$className": "HttpService", | ||
"$properties": { | ||
"HttpEnabled": true | ||
} | ||
} | ||
} | ||
|
||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,22 @@ | ||
local cache = nil | ||
local cacheSetAt = 0 | ||
return function (client) | ||
return client:makeRequest("GET", "/v1/roblox/info/") | ||
if cache then | ||
-- 20 minutes cache time | ||
if (os.time() - cacheSetAt) < 1200 then | ||
return cache | ||
else | ||
cacheSetAt = 0 | ||
cache = nil | ||
end | ||
end | ||
local result = client:makeRequest("GET", "/v1/roblox/info/") | ||
if result.error then | ||
return result | ||
else | ||
cache = result | ||
client._groupId = result.id | ||
cacheSetAt = os.time() | ||
return result | ||
end | ||
end |