mirror of
https://gitea.com/actions/stale.git
synced 2026-07-21 04:52:22 +00:00
Add RateLimit
This commit is contained in:
@@ -0,0 +1,15 @@
|
||||
import {IRateLimit, OctokitRateLimit} from '../interfaces/rate-limit';
|
||||
|
||||
export class RateLimit implements IRateLimit {
|
||||
readonly limit: number;
|
||||
readonly remaining: number;
|
||||
readonly reset: Date;
|
||||
readonly used: number;
|
||||
|
||||
constructor(rateLimit: Readonly<OctokitRateLimit>) {
|
||||
this.limit = rateLimit.limit;
|
||||
this.remaining = rateLimit.remaining;
|
||||
this.used = rateLimit.used;
|
||||
this.reset = new Date(rateLimit.reset * 1000);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user