File tree Expand file tree Collapse file tree 2 files changed +17
-6
lines changed Expand file tree Collapse file tree 2 files changed +17
-6
lines changed Original file line number Diff line number Diff line change 6
6
*/
7
7
8
8
import { logger , request , dateDiff } from "../../src/common/utils.js" ;
9
- export const RATE_LIMIT_SECONDS = 60 * 10 ; // 1 request per 10 minutes
9
+ export const RATE_LIMIT_SECONDS = 60 * 5 ; // 1 request per 10 minutes
10
10
11
11
/**
12
12
* Simple uptime check fetcher for the PATs.
@@ -98,12 +98,20 @@ const getPATInfo = async (fetcher, variables) => {
98
98
return Object . keys ( details ) . filter ( ( pat ) => details [ pat ] . status === status ) ;
99
99
} ;
100
100
101
+ const sortedDetails = Object . keys ( details )
102
+ . sort ( )
103
+ . reduce ( ( obj , key ) => {
104
+ obj [ key ] = details [ key ] ;
105
+ return obj ;
106
+ } , { } ) ;
107
+
101
108
return {
102
109
validPATs : filterPATsByStatus ( "valid" ) ,
103
110
expiredPATs : filterPATsByStatus ( "expired" ) ,
104
- exhaustedPATS : filterPATsByStatus ( "exhausted" ) ,
111
+ exhaustedPATs : filterPATsByStatus ( "exhausted" ) ,
112
+ suspendedPATs : filterPATsByStatus ( "suspended" ) ,
105
113
errorPATs : filterPATsByStatus ( "error" ) ,
106
- details,
114
+ details : sortedDetails ,
107
115
} ;
108
116
} ;
109
117
Original file line number Diff line number Diff line change @@ -88,7 +88,8 @@ describe("Test /api/status/pat-info", () => {
88
88
{
89
89
validPATs : [ "PAT_2" , "PAT_3" , "PAT_4" ] ,
90
90
expiredPATs : [ ] ,
91
- exhaustedPATS : [ "PAT_1" ] ,
91
+ exhaustedPATs : [ "PAT_1" ] ,
92
+ suspendedPATs : [ ] ,
92
93
errorPATs : [ ] ,
93
94
details : {
94
95
PAT_1 : {
@@ -132,7 +133,8 @@ describe("Test /api/status/pat-info", () => {
132
133
{
133
134
validPATs : [ "PAT_2" , "PAT_3" , "PAT_4" ] ,
134
135
expiredPATs : [ ] ,
135
- exhaustedPATS : [ ] ,
136
+ exhaustedPATs : [ ] ,
137
+ suspendedPATs : [ ] ,
136
138
errorPATs : [ "PAT_1" ] ,
137
139
details : {
138
140
PAT_1 : {
@@ -178,7 +180,8 @@ describe("Test /api/status/pat-info", () => {
178
180
{
179
181
validPATs : [ "PAT_2" , "PAT_3" , "PAT_4" ] ,
180
182
expiredPATs : [ "PAT_1" ] ,
181
- exhaustedPATS : [ ] ,
183
+ exhaustedPATs : [ ] ,
184
+ suspendedPATs : [ ] ,
182
185
errorPATs : [ ] ,
183
186
details : {
184
187
PAT_1 : {
You can’t perform that action at this time.
0 commit comments