Update app.py
Browse files
app.py
CHANGED
|
@@ -106,12 +106,12 @@ def log_mining(message):
|
|
| 106 |
async def startup_event():
|
| 107 |
"""Initialize mining components and start mining on startup"""
|
| 108 |
global miner_instance
|
| 109 |
-
if not (miner_instance and miner_instance.
|
| 110 |
log_mining("🚀 Initializing Bitcoin mining components...")
|
| 111 |
miner_instance = ParallelMiner(num_cores=5) # Increased cores for better performance
|
| 112 |
# Start mining in background thread
|
| 113 |
mining_instance = threading.Thread(
|
| 114 |
-
target=miner_instance,
|
| 115 |
kwargs={"duration": None} # Run forever
|
| 116 |
)
|
| 117 |
mining_instance.daemon = True
|
|
|
|
| 106 |
async def startup_event():
|
| 107 |
"""Initialize mining components and start mining on startup"""
|
| 108 |
global miner_instance
|
| 109 |
+
if not (miner_instance and hasattr(miner_instance, 'mining') and miner_instance.mining):
|
| 110 |
log_mining("🚀 Initializing Bitcoin mining components...")
|
| 111 |
miner_instance = ParallelMiner(num_cores=5) # Increased cores for better performance
|
| 112 |
# Start mining in background thread
|
| 113 |
mining_instance = threading.Thread(
|
| 114 |
+
target=miner_instance.start_mining,
|
| 115 |
kwargs={"duration": None} # Run forever
|
| 116 |
)
|
| 117 |
mining_instance.daemon = True
|