Web Connection
Enable Maintenance Mode Programmaticlly
Gravatar is a globally recognized avatar based on your email address. Enable Maintenance Mode Programmaticlly
  Harvey Mushman
  All
  Mar 23, 2019 @ 06:02pm

I want to run a program in the middle of the night that preforms maintenance tasks and during this period all of my users must be locked out of the system. One of the processes merges data new data with old data and this process must have all the files available without anyone making changes. I also plan to make backup copies while I have exclusive access to the system.

Is there a simple way to put all of the servers into maintenance mode from within VFP and still allow me to see where in the process the system is at, like a progress page?

Or maybe I'm going about this wrong... maybe I need to have an independent application that tweaks the primary application. That way while the primary system is locked to all the uses the second application could be running processes and feeding back progress status.

Any thoughts?

Gravatar is a globally recognized avatar based on your email address. re: Enable Maintenance Mode Programmaticlly
  Rick Strahl
  Harvey Mushman
  Mar 25, 2019 @ 12:56am

You can use wwHttp to create a FoxPro program that hits the appropriate commands on the Module Admin page.

Probably in this order:

  • Toggle Hold Requests (on)
  • Load Single Server
  • Trigger your maintenance tasks
  • Load Servers
  • Toggle Hold Requests (off)

You can get the HTTP links from admin page - they are all simple GET requests and you'll need to provide username and password to authenticate.

You'll probably also want to check the output that comes back and look for specific things in the HTML returned. You'll want to make sure each command worked by doing an ATC() for a value that confirms the request worked and the app is in the right mode.

Been a while since I've done this but it's pretty straight forward.

You can look at the new project build.prg file (create one if you don't have one) to get an idea how to do these sort of commands, as that's what the update process does on a less involved scale - first upload a file, then hotswap the files all via HTTP links (but it's only 2 vs. 5 or 6 that you'll need).

+++ Rick ---

© 1996-2024