#8 Sending Telegram message to Paddy in case the SQL server is down
This commit is contained in:
		
							parent
							
								
									1ec878378b
								
							
						
					
					
						commit
						d2d904cf06
					
				
							
								
								
									
										3
									
								
								main.py
									
									
									
									
									
								
							
							
						
						
									
										3
									
								
								main.py
									
									
									
									
									
								
							| 
						 | 
					@ -9,6 +9,9 @@ def runPings():
 | 
				
			||||||
	telegram = TelegramHandler.TelegramHandler()
 | 
						telegram = TelegramHandler.TelegramHandler()
 | 
				
			||||||
	conn = SQLConnectionHandler.getConnection()
 | 
						conn = SQLConnectionHandler.getConnection()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						if not conn:
 | 
				
			||||||
 | 
							telegram.sendMessage('230970888', 'Your SQL Server seems to be offline. Maybe give it a check as soon as possible.')
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	# Get data from SQL
 | 
						# Get data from SQL
 | 
				
			||||||
	users = getUsers(conn)
 | 
						users = getUsers(conn)
 | 
				
			||||||
	servers = getServersToPing(conn)
 | 
						servers = getServersToPing(conn)
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue
	
	Block a user