Code Monkey home page Code Monkey logo

Comments (6)

turbo124 avatar turbo124 commented on June 6, 2024

the payment_balance column is delayed in its value. ie. if you perform a payment action, it may take 5 minutes for the payment_balance to update. could this explain it?

from invoiceninja.

CarrnellTech avatar CarrnellTech commented on June 6, 2024

I believe the payment was applied yesterday. So that exceeds 5 minutes. If it is delayed, perhaps I jumped the gun a bit and it will fix itself tonight?

Also, when you said column that made me wonder if this can also be seen in the client list. And yes it is also seen there! A much easier way to see the value output without editing the code.
image

Additional picture of the payment applied to automatically created invoice.
image

from invoiceninja.

turbo124 avatar turbo124 commented on June 6, 2024

Do you have the cron scheduler running? There is a scheduled task which updates this field every 5 minutes.

from invoiceninja.

CarrnellTech avatar CarrnellTech commented on June 6, 2024

I am running the application in a docker container. I have not changed anything other than some small html/php snippets.


Here is the crontab on my docker container:
/var/www/app> cat /etc/crontabs/root 
# do daily/weekly/monthly maintenance
# min   hour    day     month   weekday command
*/15    *       *       *       *       run-parts /etc/periodic/15min
0       *       *       *       *       run-parts /etc/periodic/hourly
0       2       *       *       *       run-parts /etc/periodic/daily
0       3       *       *       6       run-parts /etc/periodic/weekly
0       5       1       *       *       run-parts /etc/periodic/monthly

Here is a capture of my recent logs
  2024-04-04 20:20:00 Running [queue-size-job] ..................... 17ms DONE
  2024-04-04 20:20:00 Running [Callback] ............................ 7ms DONE
  2024-04-04 20:20:02 App\Jobs\Ninja\QueueSize ....................... RUNNING
  2024-04-04 20:20:02 App\Jobs\Ninja\QueueSize ................... 3.20ms DONE
   INFO  No scheduled commands are ready to run.  
   INFO  No scheduled commands are ready to run.  
   INFO  No scheduled commands are ready to run.  
[REDACTED] -  04/Apr/2024:20:23:14 +0000 "GET /index.php" 200
[REDACTED] -  04/Apr/2024:20:23:15 +0000 "GET /index.php" 200
[REDACTED] -  04/Apr/2024:20:23:15 +0000 "GET /index.php" 200
[REDACTED] -  04/Apr/2024:20:23:15 +0000 "GET /index.php" 200
   INFO  No scheduled commands are ready to run.  
  2024-04-04 20:25:00 Running [queue-size-job] ..................... 16ms DONE
  2024-04-04 20:25:00 Running [Callback] ............................ 7ms DONE
  2024-04-04 20:25:02 App\Jobs\Ninja\QueueSize ....................... RUNNING
  2024-04-04 20:25:02 App\Jobs\Ninja\QueueSize ................... 3.48ms DONE
   INFO  No scheduled commands are ready to run.  
   INFO  No scheduled commands are ready to run.  
   INFO  No scheduled commands are ready to run.  
[REDACTED] -  04/Apr/2024:20:28:39 +0000 "POST /index.php" 200
[REDACTED] -  04/Apr/2024:20:28:40 +0000 "GET /index.php" 200
[REDACTED] -  04/Apr/2024:20:28:40 +0000 "GET /index.php" 200
[REDACTED] -  04/Apr/2024:20:28:40 +0000 "GET /index.php" 200
[REDACTED] -  04/Apr/2024:20:28:44 +0000 "GET /index.php" 200
[REDACTED] -  04/Apr/2024:20:28:44 +0000 "GET /index.php" 200
[REDACTED] -  04/Apr/2024:20:28:46 +0000 "GET /index.php" 200
[REDACTED] -  04/Apr/2024:20:28:46 +0000 "GET /index.php" 200
[REDACTED] -  04/Apr/2024:20:28:47 +0000 "GET /index.php" 200
[REDACTED] -  04/Apr/2024:20:28:47 +0000 "GET /index.php" 200
[REDACTED] -  04/Apr/2024:20:28:47 +0000 "GET /index.php" 200
[REDACTED] -  04/Apr/2024:20:28:47 +0000 "GET /index.php" 200
[REDACTED] -  04/Apr/2024:20:28:47 +0000 "GET /index.php" 200
[REDACTED] -  04/Apr/2024:20:28:47 +0000 "GET /index.php" 200
[REDACTED] -  04/Apr/2024:20:28:47 +0000 "GET /index.php" 200
   INFO  No scheduled commands are ready to run.  
  2024-04-04 20:30:00 Running [queue-size-job] ..................... 21ms DONE
  2024-04-04 20:30:00 Running [stale-invoice-job] ................... 3ms DONE
  2024-04-04 20:30:00 Running [Callback] ............................ 8ms DONE
  2024-04-04 20:30:02 App\Jobs\Subscription\CleanStaleInvoiceOrder ... RUNNING
  2024-04-04 20:30:02 App\Jobs\Ninja\QueueSize ....................... RUNNING
  2024-04-04 20:30:02 App\Jobs\Ninja\QueueSize ................... 6.73ms DONE
  2024-04-04 20:30:02 App\Jobs\Subscription\CleanStaleInvoiceOrder  18.24ms DONE
   INFO  No scheduled commands are ready to run.  
   INFO  No scheduled commands are ready to run.  
   INFO  No scheduled commands are ready to run.  
   INFO  No scheduled commands are ready to run.  
  2024-04-04 20:35:00 Running [queue-size-job] ..................... 17ms DONE
  2024-04-04 20:35:00 Running [Callback] ............................ 6ms DONE
  2024-04-04 20:35:03 App\Jobs\Ninja\QueueSize ....................... RUNNING
  2024-04-04 20:35:03 App\Jobs\Ninja\QueueSize ................... 4.28ms DONE
   INFO  No scheduled commands are ready to run.  
   INFO  No scheduled commands are ready to run.  
   INFO  No scheduled commands are ready to run.  
   INFO  No scheduled commands are ready to run.  
  2024-04-04 20:40:00 Running [queue-size-job] ..................... 33ms DONE
  2024-04-04 20:40:00 Running [update-calculated-fields-job] ....... 12ms DONE
  2024-04-04 20:40:00 Running [Callback] ............................ 7ms DONE
  2024-04-04 20:40:03 App\Jobs\Ninja\QueueSize ....................... RUNNING
  2024-04-04 20:40:03 App\Jobs\Ninja\QueueSize ................... 5.32ms DONE
   INFO  No scheduled commands are ready to run.  
   INFO  No scheduled commands are ready to run.  
   INFO  No scheduled commands are ready to run.  
   INFO  No scheduled commands are ready to run.  
  2024-04-04 20:45:00 Running [queue-size-job] ..................... 14ms DONE
  2024-04-04 20:45:00 Running [Callback] ............................ 6ms DONE
  2024-04-04 20:45:03 App\Jobs\Ninja\QueueSize ....................... RUNNING
  2024-04-04 20:45:03 App\Jobs\Ninja\QueueSize ................... 5.94ms DONE
   INFO  No scheduled commands are ready to run.  
   INFO  No scheduled commands are ready to run.  
   INFO  No scheduled commands are ready to run.  
   INFO  No scheduled commands are ready to run.  

Just for some added contexts, I pull the latest docker image, override the original entry point script add extra commands to change the html/php snippets, then immediately call the original entrypoint script while leaving the original calling parameters in place. (I have been wanting to get into building docker images without that entrypoint override, but have not had the time to fully do that properly yet.) This is purely to make cosmetic changes for our specific use case.

from invoiceninja.

CarrnellTech avatar CarrnellTech commented on June 6, 2024

I thought to also get the daemon controller Supervisord and currently running processes if that helps.


Supervisord.conf on my docker container during production:
[supervisord]
nodaemon=true
pidfile=/tmp/supervisord.pid
logfile=/dev/null ; nodaemon will cause logs to go to stdout
logfile_maxbytes=0
loglevel=info

[program:php-fpm]
redirect_stderr=true
stdout_logfile=/dev/stdout
stdout_logfile_maxbytes=0
stderr_logfile=/dev/stderr
stderr_logfile_maxbytes=0
command=php-fpm

[program:scheduler]
autorestart=true
redirect_stderr=true
stdout_logfile=/dev/stdout
stdout_logfile_maxbytes=0
stderr_logfile=/dev/stderr
stderr_logfile_maxbytes=0
command=php artisan schedule:work

[program:queue-worker]
process_name=%(program_name)s_%(process_num)02d
autorestart=true
redirect_stderr=true
stdout_logfile=/dev/stdout
stdout_logfile_maxbytes=0
stderr_logfile=/dev/stderr
stderr_logfile_maxbytes=0
numprocs=2
command=php artisan queue:work --sleep=3 --tries=1 --memory=256 --timeout=3600

[eventlistener:shutdown]
command=shutdown.sh
events=PROCESS_STATE_STOPPED, PROCESS_STATE_EXITED, PROCESS_STATE_FATAL
stdout_logfile=/dev/stdout
stdout_logfile_maxbytes=0
stderr_logfile=/dev/stderr
stderr_logfile_maxbytes=0

Top on my docker container during production:
Mem: 7855196K used, 280692K free, 97776K shrd, 248052K buff, 1261424K cached
CPU:  57% usr   3% sys   0% nic  39% idle   0% io   0% irq   0% sirq
Load average: 0.21 0.20 0.21 4/888 202
  PID  PPID USER     STAT   VSZ %VSZ CPU %CPU COMMAND
   69    65 invoicen S     181m   2%   1   0% php-fpm: pool www
   70    65 invoicen S     179m   2%   0   0% php-fpm: pool www
   65    13 invoicen S     178m   2%   0   0% php-fpm: master process (/usr/local/etc/php-fpm.conf)
   66    13 invoicen S     103m   1%   1   0% php artisan queue:work --sleep=3 --tries=1 --memory=256 --timeout=3600
   67    13 invoicen S     103m   1%   0   0% php artisan queue:work --sleep=3 --tries=1 --memory=256 --timeout=3600
   68    13 invoicen S     101m   1%   0   0% php artisan schedule:work
   13     1 invoicen S    28232   0%   0   0% {supervisord} /usr/bin/python3 /usr/bin/supervisord
  148     0 root     S     1700   0%   2   0% sh
    1     0 invoicen S     1632   0%   0   0% sh /usr/local/bin/prepend_entrypoint.sh supervisord
   64    13 invoicen S     1628   0%   0   0% {shutdown.sh} /bin/sh /usr/local/bin/shutdown.sh
  202   148 root     R     1624   0%   0   0% top

from invoiceninja.

CarrnellTech avatar CarrnellTech commented on June 6, 2024

I have updated the docker container to v5.8.47-W156 and it has not changed the issue.
image

from invoiceninja.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.