File tree Expand file tree Collapse file tree
src/api/tools/repoHandlers Expand file tree Collapse file tree Original file line number Diff line number Diff line change 99import { incrementRepoViewCount } from "../../utils/badge.js" ;
1010import rawMapping from "./generic/static-mapping.json" ;
1111
12+ const badgeCountAllowedRepos = [ "mcp-ui" , "git-mcp" ] ;
13+
1214class GenericRepoHandler implements RepoHandler {
1315 name = "generic" ;
1416 getTools ( _ : RepoData , env : any , ctx : any ) : Array < Tool > {
@@ -54,15 +56,17 @@ class GenericRepoHandler implements RepoHandler {
5456 } ;
5557 }
5658
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+ }
6670
6771 return {
6872 content : [
You can’t perform that action at this time.
0 commit comments