Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Keep backward compatibility on v token price endpoint #146

Merged
merged 2 commits into from
Mar 25, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/controllers/TokenStatsController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,8 @@ export class TokenStatsController extends ControllerBase implements IControllerB
const currency = req.query.currency as string | undefined;
res.json(await this._priceProvider.getPrice(req.params.symbol, currency));
} catch (err) {
this.handleError(res, err as Error);
// For the sake of backward compatibility
res.json(0);
}
});

Expand Down
1 change: 0 additions & 1 deletion src/services/CacheService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

constructor(private cachedItemValidityTimeMs: number = 60000) {}

public getItem(key: string): CacheItem<T> | undefined{

Check failure on line 13 in src/services/CacheService.ts

View workflow job for this annotation

GitHub Actions / Code Style Check (18.x)

Insert `·`
Guard.ThrowIfUndefined('key', key);

const cacheItem = this.cache.get(key);
Expand All @@ -24,7 +24,6 @@

public setItem(key: string, item: T): void {
Guard.ThrowIfUndefined('key', key);
Guard.ThrowIfUndefined('item', item);

this.cache.set(key, {
data: item,
Expand Down
Loading