Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Solved
  • Unsolved
  • Users
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (Darkly)
  • No Skin
Collapse
brainCloud Forums
  1. Home
  2. General
  3. How to implement Scheduled Scripts

How to implement Scheduled Scripts

Scheduled Pinned Locked Moved Solved General
3 Posts 2 Posters 1.2k Views 2 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • T Offline
    T Offline
    tristan
    wrote on last edited by
    #1

    I'm a bit new to server stuff and am having trouble with understanding how to schedule a script to run weekly. I want to send each user an email of their weekly progress.
    I have it currently set up to send them an email once a week by checking when the leaderboard needs to be reset. But this is not using cloud code scripting and they are required to open the app (which then checks the leaderboard reset time, which triggers a email to be sent) to do this. Is there any clear explanation setting up scheduling scripts and having them automatically repeat weekly?
    Thanks

    1 Reply Last reply
    0
    • Paul WinterhalderP Offline
      Paul WinterhalderP Offline
      Paul Winterhalder
      brainCloudAdmin
      wrote on last edited by
      #2

      Hi,

      The general approach is to have your script re-schedule itself immediately when it runs (before it does the rest of it's processing).

      So then - you just schedule it to run the first time... and each time it runs it re-schedules itself to run again.

      You want to re-schedule the script immediately before you do the rest of the processing - so that if there happens to be an error in your script - the rescheduling still happens... (otherwise your weekly cycle would stop).

      I hope that helps!

      Paul.

      1 Reply Last reply
      0
      • T Offline
        T Offline
        tristan
        wrote on last edited by
        #3

        Great. This perfectly answers my question. Thank you!

        1 Reply Last reply
        0
        • T tristan has marked this topic as solved on

        Hello! It looks like you're interested in this conversation, but you don't have an account yet.

        Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

        With your input, this post could be even better 💗

        Register Login
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Solved
        • Unsolved
        • Users