File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -15,11 +15,25 @@ function captureOllamaVersions(
1515 daemonVersion : string | null ,
1616 binaryVersion : string | null ,
1717) : ( command : readonly string [ ] ) => string {
18- const responses = new Map ( [
19- [ "curl" , daemonVersion ? JSON . stringify ( { version : daemonVersion } ) : "" ] ,
20- [ "ollama" , binaryVersion ? `ollama version is ${ binaryVersion } ` : "" ] ,
18+ const responses = new Map < string , string > ( [
19+ [
20+ JSON . stringify ( [
21+ "curl" ,
22+ "-sf" ,
23+ "--connect-timeout" ,
24+ "2" ,
25+ "--max-time" ,
26+ "5" ,
27+ "http://127.0.0.1:11434/api/version" ,
28+ ] ) ,
29+ daemonVersion ? JSON . stringify ( { version : daemonVersion } ) : "" ,
30+ ] ,
31+ [
32+ JSON . stringify ( [ "ollama" , "--version" ] ) ,
33+ binaryVersion ? `ollama version is ${ binaryVersion } ` : "" ,
34+ ] ,
2135 ] ) ;
22- return ( command ) => responses . get ( command [ 0 ] ?? "" ) ?? "" ;
36+ return ( command ) => responses . get ( JSON . stringify ( command ) ) ?? "" ;
2337}
2438
2539describe ( "resolveRunningOllamaMenuEntry" , ( ) => {
You can’t perform that action at this time.
0 commit comments