Implement API rate limit handling support (#227)
* Merged all IGDB API communications into one class * Added code to handle IGDB's rate limiter * Revised IGDB rate limit avoidance and recovery times
This commit is contained in:
@@ -12,12 +12,6 @@ namespace gaseous_server.Classes.Metadata
|
||||
{
|
||||
}
|
||||
|
||||
private static IGDBClient igdb = new IGDBClient(
|
||||
// Found in Twitch Developer portal for your app
|
||||
Config.IGDB.ClientId,
|
||||
Config.IGDB.Secret
|
||||
);
|
||||
|
||||
public static InvolvedCompany? GetInvolvedCompanies(long? Id)
|
||||
{
|
||||
if ((Id == 0) || (Id == null))
|
||||
@@ -113,7 +107,8 @@ namespace gaseous_server.Classes.Metadata
|
||||
// get InvolvedCompanies metadata
|
||||
try
|
||||
{
|
||||
var results = await igdb.QueryAsync<InvolvedCompany>(IGDBClient.Endpoints.InvolvedCompanies, query: fieldList + " " + WhereClause + ";");
|
||||
Communications comms = new Communications();
|
||||
var results = await comms.APIComm<InvolvedCompany>(IGDBClient.Endpoints.InvolvedCompanies, fieldList, WhereClause);
|
||||
var result = results.First();
|
||||
|
||||
return result;
|
||||
|
Reference in New Issue
Block a user