R
R
rockwell3232020-07-25 23:52:41
JavaScript
rockwell323, 2020-07-25 23:52:41

Why does the program window hang on electron.js?

Hello. I am writing the first desktop program using (js, nodejs, electron js, bootstrap). In general, I run the script by pressing the button, everything works fine for about a minute plus or minus, the essence of the script is Download the database, parse the information I need and write it to a regular txt file (this is enough for me). The window freezes, I just can’t go through other menu items or something else. The script works, but here is the problem with the program window. Without running the script for downloading and recording, everything works fine!
What could be the problem?

Z.Y. There is an assumption that this is all due to asynchronous writing to txt fs.appendFile()

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander, 2020-07-26
@Seasle

Or rather, because of synchronous work , take out the code for writing to a file in a separate thread. And yet, it's better to form the entire file in a variable, and then overwrite it 1 time than to append the file several times if you do so.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question