Re: Euphoria MVC updates
- Posted by ghaberek (admin) Nov 12, 2021
- 3010 views
It looks like a missing sqlite database caused the crash. When adding the file, the server runs and crashes with traces on the next error.
Yeah nothing your code is creating a database so that needs to exist already. This is what I was talking about in the other thread about migrations. We need a way to "bootstrap" an application and its database.
I should probably include a call to flush() in the inner loop of log_message(). I have a feeling some things are getting logged but they're buffered so you never see them.
I also plan to add one or more crash routines to provide better crash output to the browser, close log files, and disconnect any databases.
I definitely think browser crash messages from the development server would be helpful. Right now the browser just spins waiting for a response while the server has crashed.
II also needed to replace "include std/map.e" with "include mvc/mapdbg.e as map"
You shouldn't have to do that since, as its name implies, mapdbg is only for debugging maps. You have to have MAPDBG defined in eu.cfg or on the command line (-D MAPDBG) for it to work anyway. Otherwise it just acts as a passthrough to std/map.e.
namespace mapdbg ifdef not MAPDBG then public include std/map.e elsedef ...
What mapdbg does, if you're curious, is trace any calls to maps that are created so you can verify they're being cleaned up correctly. I was having issues with the development server early on, where continuous use would create maps without freeing them, resulting in a memory leak. I think I've got that under control now. It also provides a neat print_map() function for seeing the (possibly nested) structure of the maps you've created. There is also print_maps() which will display all of the maps it knows about at that time.
-Greg