'Scheduler entry point, creates notification tasks for all
active subscriptions which (may) have updates.'

@classmethod
def check_subscriptions(cls):

    _debug = current.log.debug
    now = datetime.datetime.utcnow()
    _debug(('S3Notifications.check_subscriptions(now=%s)' % now))
    subscriptions = cls._subscriptions(now)
    if subscriptions:
        async = current.s3task.async
        for row in subscriptions:
            row.update_record(locked=True)
            async('notify_notify', args=[row.id])
        message = ('%s    notifications    scheduled.' % len(subscriptions))
        current.db.commit()
    else:
        message = 'No    notifications    to    schedule.'
    _debug(message)
    return message
