Skip to content

Commit

Permalink
[fix] debug console (pdb) in a session started by make run
Browse files Browse the repository at this point in the history
Commit c7f2740 moves the `python -m searx.webapp` process to the background.  A
background job can't open a simple python-debugger (pdb) console.

This patch moves all processes to the background except the searx.webapp.

Insert a break point somewhere in the webapp application::

    import pdb
    pdb.set_trace()

And start a debug session by::

    make run

and test you break point.

To test that the entire 'make run' stops in the case of an error in the
themes.live [1] background process try:

    make LIVE_THEME=typo-theme-name run

[1] searxng#664 (comment)

Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
  • Loading branch information
return42 committed Jan 5, 2022
1 parent 00d3a74 commit c9cfa61
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions manage
Original file line number Diff line number Diff line change
Expand Up @@ -121,14 +121,18 @@ fi
export DOCS_BUILD

webapp.run() {
SEARXNG_DEBUG=1 pyenv.cmd python -m searx.webapp &
sleep 3
if [ "${LIVE_THEME}" ]; then
themes.live "${LIVE_THEME}" &
fi
xdg-open http://127.0.0.1:8888/
wait -n
kill 0
local parent_proc="$$"
(
if [ "${LIVE_THEME}" ]; then
( themes.live "${LIVE_THEME}" )
kill $parent_proc
fi
)&
(
sleep 3
xdg-open http://127.0.0.1:8888/
)&
SEARXNG_DEBUG=1 pyenv.cmd python -m searx.webapp
}

buildenv() {
Expand Down

0 comments on commit c9cfa61

Please sign in to comment.