logging.error('failed to make movie thumbnail: %(msg)s' % {
'msg': unicode(e)})
- ioloop.add_timeout(datetime.timedelta(seconds=settings.MJPG_CLIENT_TIMEOUT), do_next_movie_thumbail)
+ ioloop.add_timeout(datetime.timedelta(seconds=settings.THUMBNAILER_INTERVAL), do_next_movie_thumbail)
- ioloop.add_timeout(datetime.timedelta(seconds=settings.MJPG_CLIENT_TIMEOUT), do_next_movie_thumbail)
+ ioloop.add_timeout(datetime.timedelta(seconds=settings.THUMBNAILER_INTERVAL), do_next_movie_thumbail)
if __name__ == '__main__':
# interval in seconds at which the janitor is called to remove old pictures and movies
CLEANUP_INTERVAL = 43200
+# interval in seconds at which the thumbnail mechanism runs
+THUMBNAILER_INTERVAL = 60
+
# timeout in seconds to wait for responses when contacting a remote server
REMOTE_REQUEST_TIMEOUT = 10
client.close()
-# run the garbage collector for the first time;
-# this will start the timeout mechanism
-_garbage_collector()
\ No newline at end of file
+# schedule the garbage collector
+io_loop = ioloop.IOLoop.instance()
+io_loop.add_timeout(datetime.timedelta(seconds=settings.MJPG_CLIENT_TIMEOUT), _garbage_collector)