Spaces:
Runtime error
Runtime error
Update app2.py
Browse files
app2.py
CHANGED
@@ -148,6 +148,13 @@ def stop_monitoring(url: str):
|
|
148 |
asyncio.create_task(cleanup_resources(url))
|
149 |
del monitoring_tasks[url]
|
150 |
return "Monitoring stopped"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
151 |
def generate_rss_feed():
|
152 |
session = Session()
|
153 |
try:
|
@@ -221,13 +228,6 @@ async def periodic_update_with_error_handling(db_session):
|
|
221 |
except Exception as e:
|
222 |
logger.error(f"Error in periodic update: {e}")
|
223 |
|
224 |
-
|
225 |
-
async def on_start_click(target_urls_str: str, storage_loc: str, feed_enabled: bool):
|
226 |
-
urls = [url.strip() for url in target_urls_str.split(",")] # Split the input string by commas
|
227 |
-
await start_monitoring(urls, storage_loc if storage_loc else None, feed_enabled)
|
228 |
-
return "Monitoring started for valid URLs."
|
229 |
-
|
230 |
-
|
231 |
async def main():
|
232 |
global db_session
|
233 |
try:
|
|
|
148 |
asyncio.create_task(cleanup_resources(url))
|
149 |
del monitoring_tasks[url]
|
150 |
return "Monitoring stopped"
|
151 |
+
|
152 |
+
async def on_start_click(target_urls_str: str, storage_loc: str, feed_enabled: bool):
|
153 |
+
urls = [url.strip() for url in target_urls_str.split(",")] # Split the input by commas
|
154 |
+
result = await start_monitoring(urls, storage_loc if storage_loc else None, feed_enabled)
|
155 |
+
return result
|
156 |
+
|
157 |
+
|
158 |
def generate_rss_feed():
|
159 |
session = Session()
|
160 |
try:
|
|
|
228 |
except Exception as e:
|
229 |
logger.error(f"Error in periodic update: {e}")
|
230 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
231 |
async def main():
|
232 |
global db_session
|
233 |
try:
|