Update main.ts#1649
Closed
victor-lucrabot wants to merge 1 commit intoEvolutionAPI:developfrom
victor-lucrabot:main
Closed
Update main.ts#1649victor-lucrabot wants to merge 1 commit intoEvolutionAPI:developfrom victor-lucrabot:main
victor-lucrabot wants to merge 1 commit intoEvolutionAPI:developfrom
victor-lucrabot:main
Conversation
Corrige estrutura de server.listen e inicialiazação do servidor
Contributor
Reviewer's GuideRefactored server initialization in main.ts by consolidating port configuration, streamlining error webhook handling and HTTP posting, tightening condition checks, and cleaning up whitespace and logging formatting. File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
Contributor
There was a problem hiding this comment.
Hey @victor-lucrabot - I've reviewed your changes and they look great!
Prompt for AI Agents
Please address the comments from this code review:
## Individual Comments
### Comment 1
<location> `src/main.ts:93` </location>
<code_context>
- const httpService = axios.create({ baseURL });
-
- httpService.post('', errorData);
+ axios.create({ baseURL }).post('', errorData);
}
</code_context>
<issue_to_address>
The axios POST request is not awaited or handled.
If you want to ensure error delivery, handle the promise or log failures from the POST request.
</issue_to_address>
<suggested_fix>
<<<<<<< SEARCH
axios.create({ baseURL }).post('', errorData);
=======
axios.create({ baseURL })
.post('', errorData)
.catch((postError) => {
logger.error('Failed to deliver error webhook:', postError);
});
>>>>>>> REPLACE
</suggested_fix>Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
| const httpService = axios.create({ baseURL }); | ||
|
|
||
| httpService.post('', errorData); | ||
| axios.create({ baseURL }).post('', errorData); |
Contributor
There was a problem hiding this comment.
suggestion: The axios POST request is not awaited or handled.
If you want to ensure error delivery, handle the promise or log failures from the POST request.
Suggested change
| axios.create({ baseURL }).post('', errorData); | |
| axios.create({ baseURL }) | |
| .post('', errorData) | |
| .catch((postError) => { | |
| logger.error('Failed to deliver error webhook:', postError); | |
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Corrige estrutura de server.listen e inicialiazação do servidor
Summary by Sourcery
Improve server bootstrap by enabling dynamic port configuration, simplifying error webhook reporting, and cleaning up initialization logic
Enhancements: