Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • spiraljacobs 2 posts 22 karma points
    Oct 15, 2020 @ 16:10
    spiraljacobs
    0

    Put up a holding page dynamically

    Essentially, what I need to do is, in the event of an external API being unavailable, put up a maintenance page.

    I have a monitoring job via hangfire that determines the health status of an external API. In the event of it being down, all users need to be redirected to a simple holding page of some kind.

    Traffic on one particular subfolder should be let through, as that will exist as a separate app.

    I've looked at the MaintenanceMode package https://github.com/KevinJump/Our.Umbraco.MaintenanceMode, but that didn't seem to work for my particular version of Umbraco 8 (8.7), and if it did, I'm not sure how to control it programatically.

    Thanks for the help!

  • Kevin Jump 2310 posts 14695 karma points MVP 7x c-trib
    Oct 15, 2020 @ 17:00
    Kevin Jump
    0

    Hi,

    the maintance mode package should work for Umbraco v8.7 (if you have specific errors, give us a shout we can try to fix them).

    if you where to control it programatically, I would suggest you inject the MaintenanceModeService into your hangfire job. and then you can turn the maintance mode on / off with the toggleMaintainanceMode call.

    e.g

    maintenanceModeService.ToggleMaintenanceMode(true);
    

    would turn it on.

  • spiraljacobs 2 posts 22 karma points
    Oct 15, 2020 @ 17:24
    spiraljacobs
    0

    Thanks for the reply! Thanks for the information on injecting the maintenancemodeservice! That's great.

    I'm not seeing a specific error, and nothing is showing in the logs, but the maintenance page doesn't show up when I browse to the site - it just seems to work as it always did, without showing a maintenance page at all.enter image description here

Please Sign in or register to post replies

Write your reply to:

Draft