worker: Use threading to run new site in bg
This commit is contained in:
parent
d6db4adf50
commit
cda318eeeb
@ -3,6 +3,7 @@
|
|||||||
from flask import Flask, request, jsonify
|
from flask import Flask, request, jsonify
|
||||||
import dotenv
|
import dotenv
|
||||||
import os
|
import os
|
||||||
|
import threading
|
||||||
|
|
||||||
dotenv.load_dotenv()
|
dotenv.load_dotenv()
|
||||||
|
|
||||||
@ -25,7 +26,9 @@ def new_site():
|
|||||||
sites_file.close()
|
sites_file.close()
|
||||||
|
|
||||||
# New site in background
|
# New site in background
|
||||||
new_site(domain,5000+count)
|
thread = threading.Thread(target=new_site, args=(domain, 5000 + count))
|
||||||
|
thread.start()
|
||||||
|
|
||||||
|
|
||||||
# Return the domain and the number of sites
|
# Return the domain and the number of sites
|
||||||
return jsonify({'domain': domain, 'count': count})
|
return jsonify({'domain': domain, 'count': count})
|
||||||
|
Loading…
Reference in New Issue
Block a user