Skip to content

Commit

Permalink
catching all exceptions in the main loop
Browse files Browse the repository at this point in the history
  • Loading branch information
Lukasz Dziedziul committed Nov 9, 2016
1 parent c08c1f9 commit 2ef75f2
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion matterbook.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,22 @@

log = logging.getLogger(__name__)


def main():
setup_logging()
log.info("Matterbook started")
install_interrupt_handler()
config = load_config()
graph = get_graph_api(config)
while True:
check_posts(graph, config)
try:
check_posts(graph, config)
except Exception as e:
log.error("Unexpected error: %s", e.message)
time.sleep(10)



def load_config():
with open(CONFIG_FILE, 'r') as f:
config = yaml.safe_load(f)
Expand Down

0 comments on commit 2ef75f2

Please sign in to comment.