Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
UG-Asger opened this issue Sep 2, 2024 · 13 comments

Comments

@UG-Asger
Copy link

UG-Asger commented Sep 2, 2024

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

@BaxAndrei
Copy link
Contributor

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

@Rosenstein
Copy link
Contributor

@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.

@BaxAndrei
Copy link
Contributor

BaxAndrei commented Sep 6, 2024

@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 !

@UG-Asger
Copy link
Author

UG-Asger commented Sep 6, 2024

@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?

@Rosenstein
Copy link
Contributor

@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.

@UG-Asger
Copy link
Author

UG-Asger commented Sep 6, 2024

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
Copy link
Author

UG-Asger commented Sep 6, 2024

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

@UG-Asger
Copy link
Author

UG-Asger commented Sep 6, 2024

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
Copy link
Author

UG-Asger commented Sep 6, 2024

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

@UG-Asger
Copy link
Author

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?

@Rosenstein
Copy link
Contributor

Rosenstein commented Sep 10, 2024

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 #225 will fix that error.

@UG-Asger
Copy link
Author

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

@Rosenstein
Copy link
Contributor

Those are separate issues 😉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants