lgsl icon indicating copy to clipboard operation
lgsl copied to clipboard

[V7.0.0 Latest] Time chart not keeping history (Set for 24 hours in config)

Open UG-Asger opened this issue 1 year ago • 13 comments

I would expect the chart to keep the history for the last 24 hours when the server has been online, but I only see the amount of current players? image

UG-Asger avatar Sep 02 '24 16:09 UG-Asger

I have the same issue. Maybe is something wrong withy my config. Any ideea @tltneon ? image image image Thank you!

BaxAndrei avatar Sep 02 '24 18:09 BaxAndrei

@UG-Asger

I would expect the chart to keep the history for the last 24 hours when the server has been online, but I only see the amount of current players?

Seems to be working fine @ https://github.com/tltneon/lgsl/tree/854d5aeb95bc9c4b3dc0da11404bda464f0417b1 commit in XAMPP PHP 8.2.4 dev environment

image Do you have task setup to execute "..../lgsl/lgsl_files/lgsl_cron.php" at regular intervals?

@BaxAndrei

I have the same issue. Maybe is something wrong withy my config. Any ideea @tltneon ? Thank you!

Those addresses don't appear as valid to me.

Rosenstein avatar Sep 05 '24 17:09 Rosenstein

@Rosenstein

Those addresses don't appear as valid to me.

They are docker addresses, they have an IP behind them.

Do you have task setup to execute "..../lgsl/lgsl_files/lgsl_cron.php" at regular intervals?

Yes. It is configured

EDIT: I see before v7.0.0 src folder was named lgsl_files. I updated my cron. Now I will wait few hours to see if now it works normal. Thank you!

EDIT 2: Everything is now working fine. Thank you @Rosenstein !

BaxAndrei avatar Sep 06 '24 07:09 BaxAndrei

@Rosenstein I was not aware of the cron job. I'm a noob at all this coding stuff. I have made a scheduled task now to run every minute. On Windows Server 2022 Datacenter with xampp (PHP 8.1.2). The schedule runs a .bat file with following content: C:\xampp\php\php.exe C:\xampp\htdocs\e107\lgsl7\src\lgsl_cron.php. Is that correct?

UG-Asger avatar Sep 06 '24 13:09 UG-Asger

@UG-Asger

That would be correct. From https://github.com/tltneon/lgsl/wiki#page-loads-slowly

If you have more than 20 servers in your list, and you need the server information to be more accurate as to current players and map information, then you can schedule updates.

Since LGSL updates when viewed, there has to be a limit on the update time otherwise the page would take a long time to load while it polls all the servers.

By scheduling the webserver to 'view' LGSL at regular intervals, the server information is cached ready for when a visitor views LGSL. Scheduling on webservers is known as a 'cron job'.

Setting up a cron differs between hosts, so you may need find out what method your host supports, but here are examples of cron commands that I have used in the past.

curl --compressed -s -o /dev/null http://*your_website*/lgsl/lgsl_files/lgsl_cron.php
wget -q -O /dev/null http://*your_website*/lgsl/lgsl_files/lgsl_cron.php
php -q /public_html/lgsl/lgsl_files/lgsl_cron.php

Before setting up the cron, its recommended that you view the lgsl_cron.php in your browser to make sure that there are no errors, and you can see how long it takes to update the servers.

I'm using D:\xampp_8.2.4\php\php-win.exe as it does not display any window while running.

Rosenstein avatar Sep 06 '24 14:09 Rosenstein

Well... No errors, so guess I'm okay ;) image But I still believe there is a bug. Not all servers are updating. Take a look here: https://urbangamers.dk/lgsl7/ image Some seem to update, but others don't

UG-Asger avatar Sep 06 '24 15:09 UG-Asger

Anyway, how often should the chart be updated? (on every cron update?)

UG-Asger avatar Sep 06 '24 15:09 UG-Asger

I started the cron job today around 15:00 CEST. If you take a look at the different servers it's all messed up with different results (all servers are running 24/7)

UG-Asger avatar Sep 06 '24 17:09 UG-Asger

And can someone explain why this server has history before I even started the cron job? image

UG-Asger avatar Sep 06 '24 17:09 UG-Asger

Seems like it is kinda working now after some time, at least the charts seems to update now, but i keep getting this php error: [10-Sep-2024 16:35:19 Europe/Copenhagen] PHP Notice: ob_flush(): Failed to flush buffer. No buffer to flush in C:\xampp\htdocs\e107\lgsl7\src\lgsl_cron.php on line 39 Any ideas?

UG-Asger avatar Sep 10 '24 14:09 UG-Asger

Seems like it is kinda working now after some time, at least the charts seems to update now, but i keep getting this php error: [10-Sep-2024 16:35:19 Europe/Copenhagen] PHP Notice: ob_flush(): Failed to flush buffer. No buffer to flush in C:\xampp\htdocs\e107\lgsl7\src\lgsl_cron.php on line 39 Any ideas?

This PR https://github.com/tltneon/lgsl/pull/225 will fix that error.

Rosenstein avatar Sep 10 '24 16:09 Rosenstein

Cool, thanks :)

Just noticed these error messages too, are they related or another issue?

[10-Sep-2[10-Sep-2024 17:53:51 Europe/Copenhagen] PHP Deprecated: Implicit conversion from float 369.90000000000003 to int loses precision in C:\xampp\htdocs\e107\lgsl7\charts.php on line 81 024 17:53:51 Europe/Copenhagen] PHP Deprecated: Implicit conversion from float 363.90000000000003 to int loses precision in C:\xampp\htdocs\e107\lgsl7\charts.php on line 83 [10-Sep-2024 17:53:51 Europe/Copenhagen] PHP Deprecated: Implicit conversion from float 403.89000000000004 to int loses precision in C:\xampp\htdocs\e107\lgsl7\charts.php on line 81 [10-Sep-2024 17:53:51 Europe/Copenhagen] PHP Deprecated: Implicit conversion from float 403.89000000000004 to int loses precision in C:\xampp\htdocs\e107\lgsl7\charts.php on line 81 [10-Sep-2024 17:53:51 Europe/Copenhagen] PHP Deprecated: Implicit conversion from float 397.89000000000004 to int loses precision in C:\xampp\htdocs\e107\lgsl7\charts.php on line 83 [10-Sep-2024 17:53:51 Europe/Copenhagen] PHP Deprecated: Implicit conversion from float 437.88 to int loses precision in C:\xampp\htdocs\e107\lgsl7\charts.php on line 81 [10-Sep-2024 17:53:51 Europe/Copenhagen] PHP Deprecated: Implicit conversion from float 437.88 to int loses precision in C:\xampp\htdocs\e107\lgsl7\charts.php on line 81 [10-Sep-2024 17:53:51 Europe/Copenhagen] PHP Deprecated: Implicit conversion from float 431.88 to int loses precision in C:\xampp\htdocs\e107\lgsl7\charts.php on line 83 [10-Sep-2024 17:53:51 Europe/Copenhagen] PHP Deprecated: Implicit conversion from float 471.87 to int loses precision in C:\xampp\htdocs\e107\lgsl7\charts.php on line 81 [10-Sep-2024 17:53:51 Europe/Copenhagen] PHP Deprecated: Implicit conversion from float 471.87 to int loses precision in C:\xampp\htdocs\e107\lgsl7\charts.php on line 81 [10-Sep-2024 17:53:51 Europe/Copenhagen] PHP Deprecated: Implicit conversion from float 465.87 to int loses precision in C:\xampp\htdocs\e107\lgsl7\charts.php on line 83 [10-Sep-2024 17:53:51 Europe/Copenhagen] PHP Deprecated: Implicit conversion from float 505.86 to int loses precision in C:\xampp\htdocs\e107\lgsl7\charts.php on line 81 [10-Sep-2024 17:53:51 Europe/Copenhagen] PHP Deprecated: Implicit conversion from float 505.86 to int loses precision in C:\xampp\htdocs\e107\lgsl7\charts.php on line 81 [10-Sep-2024 17:53:51 Europe/Copenhagen] PHP Deprecated: Implicit conversion from float 499.86 to int loses precision in C:\xampp\htdocs\e107\lgsl7\charts.php on line 83 [10-Sep-2024 17:53:51 Europe/Copenhagen] PHP Deprecated: Implicit conversion from float 539.85 to int loses precision in C:\xampp\htdocs\e107\lgsl7\charts.php on line 81 [10-Sep-2024 17:53:51 Europe/Copenhagen] PHP Deprecated: Implicit conversion from float 539.85 to int loses precision in C:\xampp\htdocs\e107\lgsl7\charts.php on line 81 [10-Sep-2024 17:53:51 Europe/Copenhagen] PHP Deprecated: Implicit conversion from float 533.85 to int loses precision in C:\xampp\htdocs\e107\lgsl7\charts.php on line 83

UG-Asger avatar Sep 10 '24 17:09 UG-Asger

Those are separate issues 😉

Rosenstein avatar Sep 11 '24 03:09 Rosenstein