When is the pow python script executed?

hi
I am tryng to modify the code at

 /usr/local/lib/python3.5/dist-packages/PoW/__init__.py

in the validator container to improve PoW speed.
IMO the script is not running in the middle of block catchup.
when does it start working? after getting the latest block?