File tree Expand file tree Collapse file tree 1 file changed +13
-9
lines changed
src/api/tools/repoHandlers Expand file tree Collapse file tree 1 file changed +13
-9
lines changed Original file line number Diff line number Diff line change 9
9
import { incrementRepoViewCount } from "../../utils/badge.js" ;
10
10
import rawMapping from "./generic/static-mapping.json" ;
11
11
12
+ const badgeCountAllowedRepos = [ "mcp-ui" , "git-mcp" ] ;
13
+
12
14
class GenericRepoHandler implements RepoHandler {
13
15
name = "generic" ;
14
16
getTools ( _ : RepoData , env : any , ctx : any ) : Array < Tool > {
@@ -54,15 +56,17 @@ class GenericRepoHandler implements RepoHandler {
54
56
} ;
55
57
}
56
58
57
- ctx . waitUntil (
58
- incrementRepoViewCount (
59
- env as CloudflareEnvironment ,
60
- repo . owner ,
61
- repo . repo ,
62
- ) . catch ( ( err ) => {
63
- console . error ( "Error incrementing repo view count:" , err ) ;
64
- } ) ,
65
- ) ;
59
+ if ( badgeCountAllowedRepos . includes ( repo . repo ) ) {
60
+ ctx . waitUntil (
61
+ incrementRepoViewCount (
62
+ env as CloudflareEnvironment ,
63
+ repo . owner ,
64
+ repo . repo ,
65
+ ) . catch ( ( err ) => {
66
+ console . error ( "Error incrementing repo view count:" , err ) ;
67
+ } ) ,
68
+ ) ;
69
+ }
66
70
67
71
return {
68
72
content : [
You can’t perform that action at this time.
0 commit comments