refactor to make a little more sense at a glance
This commit is contained in:
		
							
								
								
									
										10
									
								
								src/main.ts
									
									
									
									
									
								
							
							
						
						
									
										10
									
								
								src/main.ts
									
									
									
									
									
								
							| @ -116,7 +116,8 @@ const generateOllamaRequest = async ( | ||||
|       }); | ||||
|       const ollamaResponse: OllamaResponse = await response.json(); | ||||
|       await storePromptData(notification, ollamaResponse); | ||||
|       await postReplyToStatus(notification, ollamaResponse); | ||||
|       // await postReplyToStatus(notification, ollamaResponse); | ||||
|       return ollamaResponse; | ||||
|     } | ||||
|   } catch (error: any) { | ||||
|     throw new Error(error.message); | ||||
| @ -166,8 +167,11 @@ const postReplyToStatus = async ( | ||||
|  | ||||
| if (notifications) { | ||||
|   await Promise.all( | ||||
|     notifications.map((notification) => { | ||||
|       generateOllamaRequest(notification); | ||||
|     notifications.map(async (notification) => { | ||||
|       const ollamaResponse = await generateOllamaRequest(notification); | ||||
|       if (ollamaResponse) { | ||||
|         postReplyToStatus(notification, ollamaResponse); | ||||
|       } | ||||
|     }) | ||||
|   ); | ||||
| } | ||||
|  | ||||
		Reference in New Issue
	
	Block a user