mirror of
				https://github.com/TitanEmbeds/Titan.git
				synced 2025-11-03 23:37:09 +01:00 
			
		
		
		
	Start redis in c9 before importing webapp
This commit is contained in:
		@@ -1,11 +1,13 @@
 | 
				
			|||||||
from run import app, socketio, init_debug
 | 
					 | 
				
			||||||
import os
 | 
					 | 
				
			||||||
import subprocess
 | 
					import subprocess
 | 
				
			||||||
 | 
					 | 
				
			||||||
if __name__ == "__main__":
 | 
					if __name__ == "__main__":
 | 
				
			||||||
    running = subprocess.check_output(['ps', '-A'])
 | 
					    running = subprocess.check_output(['ps', '-A'])
 | 
				
			||||||
    if "postgres" not in str(running):
 | 
					    if "postgres" not in str(running):
 | 
				
			||||||
        subprocess.call("sudo service postgresql start", shell=True)
 | 
					        subprocess.call("sudo service postgresql start", shell=True)
 | 
				
			||||||
        subprocess.call("sudo service redis-server start", shell=True)
 | 
					        subprocess.call("sudo service redis-server start", shell=True)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					from run import app, socketio, init_debug
 | 
				
			||||||
 | 
					import os
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					if __name__ == "__main__":
 | 
				
			||||||
    init_debug()
 | 
					    init_debug()
 | 
				
			||||||
    socketio.run(app, host=os.getenv('IP', '0.0.0.0'), port=int(os.getenv('PORT', 8080)), debug=True)
 | 
					    socketio.run(app, host=os.getenv('IP', '0.0.0.0'), port=int(os.getenv('PORT', 8080)), debug=True)
 | 
				
			||||||
		Reference in New Issue
	
	Block a user