January 30, 2017 by Brian Pattison
Simple In/Out is a Rails app running on Heroku with several background jobs that need to be scheduled to run either hourly, daily, or weekly. Being on Heroku means we can easily use Heroku Scheduler to run a job every hour or every day. We could even use a daily job and check for the day of the week to accomplish weekly jobs.
We recently needed to schedule jobs to run more often than every hour, and Heroku Scheduler can no longer do everything we need it to do.
Introducing Simple Scheduler
Simple Scheduler is a scheduling add-on that is designed to be used with Sidekiq and Heroku Scheduler. It gives you the ability to schedule tasks at any interval without adding a clock process. The goal of Simple Scheduler is for it to be delightful to use and for it to ensure your scheduled jobs always run, even if there is server downtime.
Why We Created Simple Scheduler
We evaluated every possible option we could find, and every solution seemed to have the same flaw: What happens if your server is down when your job is supposed to run? TL;DR: Your job won’t run.
The existing solutions out there don’t keep track of whether a scheduled job was actually run. This means there is no way for your app to know that a job that was scheduled to run at 1:00 AM didn’t run because the server wasn’t running at 1:00 AM. What if it was a critical job that needed to run??
Another problem with certain solutions is that the job scheduling happens in the web process. This can be a huge problem if you’re on Heroku with multiple web dynos. Each web dyno would have it’s own job queue and every job would be duplicated.
One more thing we didn’t like about most other solutions is the cron format. We’re Rubyist, so we’re used to nice things. Why use such a hard to read format for scheduling your recurring jobs? Would you rather read
cron: "0 * * * *" or
every: "1.hour"? I’m nitpicking here, but I don’t want to remind myself how the cron format works every time I create or revisit a scheduled job.
How did we solve the problems with the existing solutions we evaluated?
Solution #1: Server Downtime
Simple Scheduler is set up to evaluate your configuration file every 10 minutes via Heorku Scheduler and queue jobs that need to run in the next 6 hours. A minimum of two jobs is always added to the
Sidekiq::ScheduledSet. This ensures there is always one job in the queue that can be used to determine the next run time, even if one of the two was executed during the 10 minute scheduler wait time.
If your server is down when a job was scheduled to run, it obviously won’t run at the scheduled time, but the job will still be in the Sidekiq scheduled job queue. When your server comes back online, the job will execute immediately. This brings up another problem: What if my server is down for an hour and a job is scheduled to run every 10 minutes?
By default, every job that was scheduled will be run. This means if your server is down for an hour, your every-ten-minutes job will immediately run six times when the server comes back online. This may or may not be desirable, and there are two solutions for handling how these jobs behave.
Expected Run Time vs Actual Run Time
Simple Scheduler passes the expected run time to your job’s
perform method if it accepts an argument. Let’s say you want to send a daily digest email to all users at a time they specify. Background jobs are never guaranteed to run at an exact time, so using
Time.now to find all users who want to receive the email at 8:00 AM may not work. The job may not run until 8:01 AM, or worse, it may not run until 9:00 AM. Evaluating the expected run time passed to your background job will ensure you don’t send the email to the 9:00 AM users twice and skip the 8:00 AM users.
If you have an hourly job that performs the same task every hour, you may not want it to run twice in a row if your server is down for over an hour. The Simple Scheduler config allows for an
expires_after option on a scheduled task. If you specify that a job
expires_after: "59.minutes", only the last job will run because earlier jobs will be considered expired and won’t be run.
Solution #2: Multiple Heroku Dynos
Simple Scheduler is a rake task that is run every 10 minutes via Heroku’s Scheduler, so we’re not doing any job queuing in the web process. You can have as many web dynos as you need, and your queued jobs won’t be duplicated. Once queued as a scheduled job in Sidekiq, the rest is handled by your Sidekiq worker dyno(s).
Solution #3: Pretty Configuration File
I remember having the idea of a perfect YAML configuration file in my head before creating Simple Scheduler. I told Brandon, “Let me try some README-first development to solve this.” You can see my initial README here. I presented the README and said, “I don’t know if I can pull it off, but it’s awesome, right?” It is awesome. The Simple Scheduler configuration file is so pretty and easy to understand:
# Global configuration options and their defaults. These can also be set on each task. queue_ahead: 360 # Number of minutes to queue jobs into the future tz: nil # The application time zone will be used by default # Runs once every 2 minutes simple_task: class: "SomeActiveJob" every: "2.minutes" # Runs once every day at 4:00 AM. The job will expire after 23 hours, which means the # job will not run if 23 hours passes (server downtime) before the job is actually run overnight_task: class: "SomeSidekiqWorker" every: "1.day" at: "4:00" expires_after: "23.hours" # Runs once every half hour, starting on the 30 min mark half_hour_task: class: "HalfHourTask" every: "30.minutes" at: "*:30" # Runs once every week on Saturdays at 12:00 AM weekly_task: class: "WeeklyJob" every: "1.week" at: "Sat 0:00" tz: "America/Chicago"
Start Using Simple Scheduler
I couldn’t be more proud of the work I put into making Simple Scheduler a pleasure to use, easy to understand, and I am so happy to be able to share it with the Rails community! This is some of the best code I’ve ever written, and it solves real problems.
January 21, 2017 by Brandon Medenwald
Dear Phil Schiller,
My name is Brandon Medenwald and I co-founded a small company called Simply Made Apps in Fargo, North Dakota. Our product, Simple In/Out, has embraced your developer platform since 2011. We have 3 native apps for iOS, a tvOS app (making us one of the few business apps in the tvOS Store), and a native app in the Mac App Store. I mention this to bolster my credentials as exactly the kind of developer Apple hopes to foster.
I write you today to share my frustration with the sporadic nature of App Store reviews and to offer what I believe is a great solution. I hope by the end of this letter to convince you of the merits of my idea.
The problem is the uneven application of the approval rules, the root cause being that individual App Store reviewers have broad discretion and finite time to check apps for every single one of the mounting guidelines that exist. This is understandable as reviewers are only human. The fact is that an “issue”, an item that has been approved countless times in the past, can stop our development cycle cold.
When we have a new feature to ship, many times we need to go live with all of our apps and related API services at the same time. Recently, one of our apps was rejected for violating Rule 2.3: Performance: Accurate Metadata. Specifically, we had mentioned in our app description that our 45 day free trial was available with “no credit card needed”. For any developer submitting to the App Store, these so-called “metadata” errors are perhaps the most frustrating. They are arbitrary in nature and often at the mercy of the reviewer’s interpretation. This language, for example, has been in our app description for years (plural) and has been approved every single time.
While this example stopped us in our tracks despite not being an issue in prior years, at least we were able to resolve it quickly. Other times we have not been so fortunate, like In-App Purchase demands placed on Software-as-a-Service companies like mine. In these instances, it’s weeks of work before anything else can ship even though we’ve made no changes around these “violations”.
I understand that Apple has policies that are subject to change. I also understand that Apple internally emphasizes/changes rule interpretations to clamp down on bad practices. This is all well and good, but the frustration from developers like myself is that these indiscriminate rejections appear out of nowhere and often happen at the worst possible moments. We’ve had multiple instances where bug fixes were thwarted by a seemingly-random cracking of the metadata whip.
You see Phil, I want to be a good App Store citizen and the changes your reviewers demand are not bad or unreasonable. What is unreasonable is that I cannot schedule our programming resources around rejections on existing functionality/metadata that have been approved countless times in the past. This has knock-on effects on our non-Apple developers, our customer commitments, and our marketing efforts.
I write to you not just to complain but to offer a solution that I believe will solve this problem in a way that is both fair to developers as well as to Apple. The solution comes from the real world: law enforcement and the Fix It ticket.
Let’s say you are driving down the road and you are pulled over for a broken headlight. The police officer does not issue you a fine, you are not placed in jail, and your planned trip is not measurably disrupted. You are provided with a Fix It ticket which gives you 30 days to have your headlight repaired and you resume driving. Your travel plans remain intact while you have the flexibility to schedule the repair over a month’s time. If you do not repair your headlight within 30 days, then you suffer the consequences the next time you travel.
I believe a similar solution would work wonders within the App Store review process.
If you are found in violation of a non-critical rule and that same violation existed in the previously-approved version of the app, the reviewer would approve the app for sale and would issue a Fix It ticket. This ticket would specify the violation and start the 30 day clock. After the 30 day period, Apple would block all approvals if the violation hasn’t been resolved.
This policy would allow critical bug fixes to go through without the delay caused by rules being interpreted differently from review to review. The 30 day warning would be on the developer’s account, making it easy for your App Store reviewers to see what other reviewers are doing and reject those that haven’t complied. Fix It tickets would reduce animosity towards the review process by creating a system where the only ways to have updates rejected is by creating new violations entirely or ignoring Fix It tickets for longer than 30 days. Apple can change emphasis on the guidelines without placing the hammer to all updates big and small.
Most importantly, this would allow developers like myself to schedule these fixes without arresting our entire development process.
I hope this idea can be implemented in the future for the good of Apple and the developer community. I would welcome a dialog on this matter at any time and my email address is below. Thank you for your time.
Co-Founder, Simply Made Apps, Inc.
brandon [at] simplymadeapps [dot] com
January 17, 2017 by Brandon Medenwald
With the release of Office Hours yesterday, what may have been lost in the shuffle was a new feature for our macOS app: Notifications. Simple In/Out for Mac was the last app in our family of products that didn’t have support for notifications when a user you are following updated their status.
We still have notifications built into the Safari web browser, which our Mac users have had to use to receive notifications in the past. We plan to remove this feature in the future and rely solely on our native Mac app. The Mac app allows you to manage the users you are following in one easy to use screen. The Mac app also works great with Office Hours.
For those Mac users that have used Safari to get these notifications, we recommend giving our Mac app a download from the Mac App Store. For our existing Mac customers, we hope you like the great new features we’ve added this month.
January 16, 2017 by Brandon Medenwald
Simple In/Out’s goal from the very beginning has been to be both accurate and easy, two things that are difficult to achieve at the same time. To accomplish this, Simple In/Out has been the champion of automatic features to both keep your status up-to-date as well as keep you notified about the happenings within your organization. These automatic features are what make Simple In/Out the best in/out board in the world.
While these automatic features are wonderful, there are times they can be a bit overwhelming. Perhaps your work place is in a popular area of town and you end up automatically checking in/out on the weekends while you are running errands. Maybe you have notifications sent to your phone when others change their status and they are working late in the evening. During these times, you may want Simple In/Out to halt for a bit and pick up later when you’re actually going to work.
We’re proud to announce a new feature we’ve been working on for the past few months to address these scenarios and more. We’re calling this new feature Office Hours, and it has turned out really great.
With Office Hours, you can designate windows of time that you wish Simple In/Out to perform its automatic tasks. When you’re not within those time periods Simple In/Out will stop doing things like sending you notifications and checking you in/out. When you enter back into a normally-scheduled work time, Simple In/Out will resume its normal behavior. Office Hours allows unprecedented control over our most popular features.
Want to make sure you’re not checking into job sites on your off day? No problem.
Want to stop getting notifications from other users when you’re unwinding at the end of the day? No problem.
Want to surf the web on your work laptop without checking in on a Saturday morning? No problem.
We know our power users will love Office Hours. This is only the beginning of what we’re planning for Simple In/Out this winter. We can’t wait to show you the rest of the amazing new features we’re working on.
January 13, 2017 by Brandon Medenwald
Now that we’ve entered 2017, we wanted to take a moment to recognize the year gone by. 2016 was an exciting year for our company and for Simple In/Out. We grew our family of customers, our family of products, and our family of employees. Thank you to all those customers that use Simple In/Out. You all inspire us every day to come to work and make Simple In/Out better and better.
Here are just a few of the many features we delivered in 2016.
Users belonging to multiple groups and having multiple phone numbers
This seems like such a trivial thing, but it really opened the door to a bunch of exciting new ways to organize your users. With multiple phone numbers, we’re an even better employee directory than ever.
A new API
APIv3 allows third parties to update data for the first time, enabling countless possibilities to customize Simple In/Out.
Automatic updates from your phone’s Wifi connection
Although only available for Android and Windows Phone users, automatic updates based on the internet hardware you already have in your offie is a real win for check in/out accuracy. Hey Apple: could you please add this capability to iOS so we can do this for everyone?
For a whole new class of customers, Linked Companies offers the strict separation to manage multiple companies under one user account.
The Simple In/Out Partner Program
For resellers, we offer a great program to share Simple In/Out and our host of solutions with your customers.
Simple In/Out for Mac
We launched an entirely new application to the Simple In/Out family for our Mac users.
Automatic Updates from your desktop
Now that we have desktop apps for both Windows and Mac, we launched another exciting way to have Simple In/Out update your status automatically. We now can use your computer activity to determine if you are In or Out, which for users on their computer all the time is a real time saver.
Schedule future statuses
A big request over the years was to be able to set a status that would automatically take effect when the time comes. We delivered on this in 2016.
Notifications for Windows Desktop and Windows Phone
For our Windows users, we now deliver notifications when other users you are following update their statuses. This has long been a feature of our other phone apps and now Windows receives the same love.
We translated our Simple In/Out apps and the logged-in website to our first foreign language. This is no small feat and for our Spanish users it’s like having a new solution entirely. We hope to make more gains in internationalization during the new year.
Simple In/Out TV for Amazon Fire TV
Simple In/Out TV can now be downloaded for free on the Amazon Fire TV Stick, which at $39.99 is the more inexpensive way to show your users on a big screen in a common area.
We shipped a couple of new reports this year. We also focused on improvements to our date and languages to make them even better for our overseas customers.
It is also worth noting a few non-feature things that happened in 2016.
Started Wednesday Webinars
We now have a webinar every single week for users to see new features, ask us questions, and provide us feedback. In its first year, it has been a resounding success.
Moved to a new office
In September we moved to our new office, still in the heart of downtown Fargo North Dakota.
Hired a web developer
For the first time in Simply Made Apps history, we hired another web developer. It’s hard to imagine what life was like with only one, and the pace of fantastic updates will be noticeable in 2017.
It was a busy year, and 2017 promises to be an even busier one. We can’t wait to share the great things we’re working to bring to our customers.
November 3, 2016 by Brandon Medenwald
Hot on the heals of yesterday’s announcement that Simple In/Out TV has arrived for Amazon Fire TV (and Fire TV Stick), today I’d like to talk about some of the great changes we’ve been making to reports within Simple In/Out. For many of our customers, reports are the life blood of their in/out board. Customers use them for payroll, to find discrepancies, and to simply see what happened in the past.
Today, we’ve launched a new report within Simple In/Out that has been a big request among our current users. We’re calling it the Weekly Activity report. This report allows you to see every status update for a particular user across a week or two. This is helpful for those that wish to have a printed report they can take with them. It’s like the Weekly Timeline, but instead of charts (which don’t print with the same detail), you can get daily breakdowns of all the activity for a user over the week. We think our admin users are going to love this new report.
With the Weekly Activity report, you can see a couple of new features we’ve implemented everywhere. You can run the Weekly Activity report for 7 or 14 days. We’ve expanded our other weekly report, the Weekly Timeline, to also allow for 14 days of data. This is super-helpful if you’re running these reports for payroll, as many times payroll is a 2 week issue.
Finally, we’ve added another advanced feature for a bigger customers that exist across multiple time zones. Under the Advanced link within all our reports is now a drop down for Time Zone. It will always select the time zone you’re in by default, but if you wish to run your reports in a different time zone (say you’re traveling), you can now do that via this option.
We hope these report additions make it easier than ever to see your data with Simple In/Out!
November 2, 2016 by Brandon Medenwald
In the early days of Simple In/Out, we knew we needed to build a product that allowed users to quickly see the board no matter where they were. This meant building a fast, easy to use app right on your favorite phone. Soon afterwards it became clear that Simple In/Out also needed a great way to display your board for the world to see. For this, we’ve built many features like Public Links, Fullscreen Mode, FrontDesk, and Simple In/Out TV.
Simple In/Out TV is perhaps the easiest to use of the bunch. We built Simple In/Out TV to look great on your television, which you can set up in common areas for your users to see as they come and go. We first built Simple In/Out TV for Android TV, and added AppleTV support with the release of tvOS.
The only downside to using Simple In/Out TV has been the cost to entry. Android TV devices are getting harder to find and even Google has killed its Nexus Player. AppleTV is a neat platform with room to grow, but the lowest cost device that supports apps in $150. For some businesses, this is a lot of money to spend for an in/out board.
Today, we’re happy to announce that Simple In/Out TV has come to Amazon’s Fire TV platform. With this addition, businesses have a great low-cost option to get Simple In/Out on their televisions. As of today, you can purchase a Fire TV Stick for only $39. Now it’s significantly less expensive to place Simple In/Out TV in all sorts of places, right where your users are located.
October 21, 2016 by Brandon Medenwald
Today is a dark day for internet here in the U.S., as there has been a massive internet DDoS attack underway most of the day. Simple In/Out was affected this morning in some areas, but this afternoon the second attack seems to have hit us much harder. This has affected many of the big sites on the internet today, like Amazon, Twitter, Netflix, Spotify, Github, etc.
In terms a non-geek can understand, Simple In/Out’s servers are still working great, but your phone/computer’s ability to connect with our servers may be not working.
We apologize for the intermittent problems connecting to Simple In/Out, and we hope that the DNS community can squash this soon. We also hope that these culprits are found and prosecuted swiftly.
In the meantime, if you need access to Simple In/Out, this article lists a way at the bottom you can change your device’s DNS settings to another provider that we’ve had some luck with here at our offices.
October 17, 2016 by Brandon Medenwald
Last month we moved into a new office. We were looking to have a bit more space for our expanding team. Our only requirement was staying in downtown Fargo, which is a developing technology hub that we wished to remain a part of for the foreseeable future.
Our new office is only a few blocks from our original spot, still on Broadway. Our new space is in a historic building, over 100 years old, that originally was a factory. The history is soaked into every cement column here, giving it an industrial vibe. The moment we saw this space, we instantly knew this was our new home.
Below are some images of our new space. We can’t wait to build some great new software in this inspiring location.
October 3, 2016 by Brandon Medenwald
We’re happy to announce the newest member of the Simply Made Apps team. Today, Brian Pattison is joining Simply Made Apps as a web developer.
In the Fargo technology scene, Brian is well known for his passion, his problem solving capabilities, and his eagerness to try new things. His curiosity regarding new technology is something that really separates him from others in our field.
As a full-stack web developer, Brian can do everything from back-end database to user interface design. With his help, we’re going to be able to create even more features that delight our Simple In/Out customers.
We’re thrilled to welcome Brian to the Simply Made Apps family.