NERC-CEH / npms-app

📱NPMS mobile application
http://www.npms.org.uk/
GNU General Public License v3.0
0 stars 0 forks source link

Handle website maintenance messages #58

Closed sacrevert closed 3 years ago

sacrevert commented 4 years ago

From @kazlauskis

Right now in case of website being down the app will just silently ignore if the backend is not responding. The surveys will remain on the device and once the website is up again the user will be able to re-upload everything. Ideally, this should be improved and inform the user that the website is down for maintenance.

kazlauskis commented 3 years ago

@andrewvanbreda do you know if there is a good way to programmatically check the NPMS site is down for maintenance?

andrewvanbreda commented 3 years ago

@kazlauskis Hi Karolis,

Have never had to do that, so I don't. But am sure there is a way, it is simply a standard Drupal 7 maintenance mode, no funny business going on, so if an answer exists it would just be whatever google has to say on the matter.

Actually I remember now once having to check that for another project in some form, it is just held in one of the Drupal tables if I remember. I think in D7 it can be checked with this.

if (variable_get('maintenance_mode', 0)) { //Then site is offline }

Not tried this in practice for years, so maybe be wrong about syntax etc

kazlauskis commented 3 years ago

Cheers, is there a Test/Dev NPMS site I can play with whilst testing this?

andrewvanbreda commented 3 years ago

@kazlauskis Test is here, this is attached to the live warehouse and should behave much live the real site and is generally used for that final confirmation test after main testing on my own box. Feel free to move it in and out of maintenance mode.

https://test-npms.pantheonsite.io

Dev is here

https://dev-npms.pantheonsite.io

Not this site is attached to test warehouse, and has never been completely setup (because of the work required to created all the attributes), however it may suffice for maintenance mode tests