Skip to content

Commit

Permalink
made getBuildTeamID async
Browse files Browse the repository at this point in the history
  • Loading branch information
MineFact committed Jan 25, 2024
1 parent 2efe394 commit 00289f7
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/routes/internal/GET_ResetCache.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export async function initRoutes(app: Router, joi: any, network: Network) {
}

// Validate that the Build Team is the test Build Team
if(buildTeam.getBuildTeamID() != "qtS6b2an"){
if(await buildTeam.getBuildTeamID() != "qtS6b2an"){
res.status(400).send({ error: 'Please provide a valid API key' });
return;
}
Expand Down
2 changes: 1 addition & 1 deletion src/routes/internal/GET_Stats.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export async function initRoutes(app: Router, joi: any, network: Network) {
}

// Validate that the Build Team is the test Build Team
if(buildTeam.getBuildTeamID() != "qtS6b2an"){
if(await buildTeam.getBuildTeamID() != "qtS6b2an"){
res.status(400).send({ error: 'Please provide a valid API key' });
return;
}
Expand Down
4 changes: 2 additions & 2 deletions src/struct/core/buildteam.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,9 @@ export default class BuildTeam {
this.nwDatabase = network.getNetworkDatabase();
}

getBuildTeamID(){
async getBuildTeamID(){
if(this.buildTeamID == null)
this.loadBuildTeamData();
await this.loadBuildTeamData();

return this.buildTeamID;
}
Expand Down
2 changes: 2 additions & 0 deletions src/struct/core/network.ts
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,8 @@ export default class Network {

this.updateCacheTicks = 0;

await this.updateCache();

return true;
}

Expand Down

0 comments on commit 00289f7

Please sign in to comment.