How do you safely update your app

  1. 5 weeks ago

    Richard A

    Oct 17 Pre-Release Testers, Xojo Pro Puerto Vallarta Mexico

    What is the safest way to update an app you have running on Xojo Cloud? I thought the Stats window showed the number of sessions for the selected app. It does not. There should be a way for Xojo to supply us with accurate information on what apps are running.

    In the docs it show SessionCount and gives this example:

    For i As Integer = 0 To App.SessionCount - 1
      App.SessionAtIndex(i).MsgBox("App shutdown.")
    Next

    This makes no sense to me, what does it do? I ran it in the debugger

    Session count does show the number of sessions, but am I to understand we have to put a secret function that can be called with a special click on page with modifier keys to show?

    Isn't it possible to build an app that can show you how many session for each app you have running?

    Wondering how everyone else handles it?

    Thanks

  2. Ralph A

    Oct 19 Santa Monica, California
    Edited 5 weeks ago

    My AdminPage for any Web app has a ReadOnly WebTextField that displays Str(App.SessionCount). It has two event handlers (Shown and MouseUp) with the following Action:

    Me.Text = Str(App.SessionCount)

    That way I can update it with just a mouse click on it.

  3. Richard A

    Oct 19 Pre-Release Testers, Xojo Pro Puerto Vallarta Mexico

    Could you elaborate a bit. What do you mean you can update it with a mouse click, you’re referring to the session count correct.

    In playing around why is it that it shows three sessions when I know there’s only one. Then after a little while in session count goes down.

    So if the session count shows one it’s OK then to update the app correct?

  4. Ralph A

    Oct 19 Santa Monica, California

    @RichardAlbrecht Could you elaborate a bit. What do you mean you can update it with a mouse click, you’re referring to the session count correct.

    Yes

    @RichardAlbrecht In playing around why is it that it shows three sessions when I know there’s only one. Then after a little while in session count goes down.

    It can take up to 3 minutes for a session to disappear after that session's browser tab closes.

    @RichardAlbrecht So if the session count shows one it’s OK then to update the app correct?

    No. Read up on this here: http://www.1701software.com/blog/2013/09/08/upgrading-xojo-cgi-apps

  5. Richard A

    Oct 19 Pre-Release Testers, Xojo Pro Puerto Vallarta Mexico

    Does this work on Xojo cloud?

  6. Ralph A

    Oct 19 Santa Monica, California
    Edited 5 weeks ago

    @RichardAlbrecht Does this work on Xojo cloud?

    I don't use Xojo Cloud. The whole point here is to make sure that your CGI app is not running at all when you attempt to update it. The timer mentioned in that article makes sure that the app is not running within 5 seconds after you either delete or rename the CGI file itself. Then you update your CGI app with fresh files and go from there. I don't know how Xojo Cloud works, so can't help you with this. Maybe someone else here can.

    I use serverwarp.com for Xojo hosting.

  7. Greg O

    Oct 21 Xojo Inc scout.galaxy.barn

    @RichardAlbrecht Does this work on Xojo cloud?

    It should.

  8. 4 weeks ago

    Richard A

    Oct 23 Pre-Release Testers, Xojo Pro Puerto Vallarta Mexico

    @Greg OLone

    I deleted the cgi and it still runs.

    So this method will not work.

    However if you delete the index.cgi it works, but it will close down any current session.

    So @Greg OLone what's the safest way to update an app on Xojo Cloud?

  9. 3 weeks ago

    Richard A

    Oct 29 Pre-Release Testers, Xojo Pro Puerto Vallarta Mexico

    @Greg OLone

    Any suggestions?

  10. Ralph A

    Oct 31 Santa Monica, California

    I assume you re-coded your app so that it has the App.Timer in question. However, if you were not sure that all instances of the prior version of that app were NOT running BEFORE you uploaded the new code, then the old instance is probably still running without the App.Timer. In that case, deleting the CGI file will not stop all instances of the app. You need to make sure no instance of the app is running before updating it with new files. After you do that, and then update your Web files with the version of the app that has the App.Timer, making sure no instance of the app is running is simple: either delete or rename the CGI file. After you wait the requisite amount of seconds, you can be sure no instance of the app is running and can then update it if needed.

  11. Richard A

    Oct 31 Pre-Release Testers, Xojo Pro Puerto Vallarta Mexico

    I deleted the cgi and it still runs.
    New sessions can be launched in XC.

    So this method will not work.

    However if you delete the index.cgi it will close down any all session immediately.

    So I don't see how to implement this on XC.

  12. Ralph A

    Oct 31 Santa Monica, California

    @RichardAlbrecht I deleted the cgi and it still runs.
    New sessions can be launched in XC.

    Then a version of that app was running that didn't have the App.Timer code, so it didn't die when you deleted the CGI file. Otherwise, the app would not have have started when the next user attempted to hit it. How could it if its CGI file is missing.

    If what I'm saying makes sense, you need to come up with a way, for now, to stop all instances of the app (not just its sessions). Then update the app with the new files that have the App.Timer. After you do that, you can stop all instances of the app by just renaming or deleting its CGI file.

  13. Ralph A

    Oct 31 Santa Monica, California
    Edited 3 weeks ago

    Also, I assume you are deleting the CGI file in that particular app's folder.

  14. Richard A

    Oct 31 Pre-Release Testers, Xojo Pro Puerto Vallarta Mexico

    If you delete the cgi, people can still launch it. If you delete the index.cgi, all sessions terminate instantly.

    Never put in app with timer based on my experiments.

  15. Ralph A

    Oct 31 Santa Monica, California

    @RichardAlbrecht If you delete the cgi, people can still launch it. If you delete the index.cgi, all sessions terminate instantly.

    Never put in app with timer based on my experiments.

    Then you haven't tried the method suggested, which never fails me.

  16. Richard A

    Oct 31 Pre-Release Testers, Xojo Pro Puerto Vallarta Mexico

    What I’m saying is if you delete the appname.cg You can still launch the application. So that doesn’t stop new sessions like on a non xc server. There is an index.cgi also, and if you delete that all instances of the app shut down immediately. Xojo cloud seems to be a different animal.

    Very frustrating!

  17. Ralph A

    Oct 31 Santa Monica, California

    What you're not getting is that the App.Timer will shutdown the App, not just its Sessions, when the CGI file disappears. Once that App is shutdown and the CGI is missing, nobody can start it. The reason you see new new Sessions being created even though you delete the CGI file, is because the App is running.

  18. Ralph A

    Nov 1 Santa Monica, California

    Actually, Richard, now that I think of it, tell me how you are having your users load that Web app. The URL address they should be using should end with the CGI file reference, like this:

    myserver.com/cgi-bin/MyWebApp/mywebapp.cgi

    If they attempt to load that app when the CGI file is missing, they would get an Error 400 (or something similar).

  19. Richard A

    Nov 1 Pre-Release Testers, Xojo Pro Puerto Vallarta Mexico

    XC is differant. Apps are noot launched with the cgi in the url. It's just the folder name.

    If you delete the cgi, you can still launch the app.

    There is an index.cgi also. If you delete that it shuts down all sessions. So it doesn't work the same as on other servers.

    If you would like to write a test app I can deploy it as an experiment.

  20. Richard A

    Nov 1 Pre-Release Testers, Xojo Pro Puerto Vallarta Mexico

    @Greg OLone

    Any input for us mere mortals?

  21. Newer ›

or Sign Up to reply!