@@ -6,14 +6,15 @@ import (
6
6
"encoding/json"
7
7
"errors"
8
8
"fmt"
9
- "github.com/0chain/gosdk/core/zcncrypto"
10
9
"net/http"
11
10
"os"
12
11
"runtime/pprof"
13
12
"strconv"
14
13
"strings"
15
14
"time"
16
15
16
+ "github.com/0chain/gosdk/core/zcncrypto"
17
+
17
18
"github.com/0chain/blobber/code/go/0chain.net/core/transaction"
18
19
19
20
"github.com/go-openapi/runtime/middleware"
@@ -222,7 +223,7 @@ func setupHandlers(s *mux.Router) {
222
223
s .HandleFunc ("/_config" , common .AuthenticateAdmin (common .ToJSONResponse (GetConfig )))
223
224
// s.HandleFunc("/_config", RateLimitByCommmitRL(common.ToJSONResponse(GetConfig)))
224
225
// s.HandleFunc("/_stats", common.AuthenticateAdmin(StatsHandler)))
225
- s .HandleFunc ("/_stats " , RateLimitByCommmitRL (StatsHandler ))
226
+ s .HandleFunc ("/objectlimit " , RateLimitByCommmitRL (common . ToJSONResponse ( GetObjectLimit ) ))
226
227
227
228
s .HandleFunc ("/_logs" , RateLimitByCommmitRL (common .ToJSONResponse (GetLogs )))
228
229
@@ -1630,6 +1631,16 @@ func GetConfig(ctx context.Context, r *http.Request) (interface{}, error) {
1630
1631
return config .Configuration , nil
1631
1632
}
1632
1633
1634
+ func GetObjectLimit (ctx context.Context , r * http.Request ) (interface {}, error ) {
1635
+ var objLimit struct {
1636
+ MaxAllocationDirFiles int
1637
+ MaxObjectsInDir int
1638
+ }
1639
+ objLimit .MaxAllocationDirFiles = config .Configuration .MaxAllocationDirFiles
1640
+ objLimit .MaxObjectsInDir = config .Configuration .MaxObjectsInDir
1641
+ return objLimit , nil
1642
+ }
1643
+
1633
1644
func GetLogs (ctx context.Context , r * http.Request ) (interface {}, error ) {
1634
1645
return transaction .Last50Transactions , nil
1635
1646
}
0 commit comments