Spaces:
Sleeping
Sleeping
use async and removed UX
Browse files
app.py
CHANGED
|
@@ -192,8 +192,8 @@ streams = {
|
|
| 192 |
}
|
| 193 |
|
| 194 |
# Function to run on button click
|
| 195 |
-
@webhook_endpoint
|
| 196 |
-
def update_streams(
|
| 197 |
speckle_token = os.environ.get("SPECKLE_TOKEN")
|
| 198 |
notion_token = os.environ.get("NOTION_TOKEN")
|
| 199 |
|
|
@@ -210,6 +210,7 @@ def update_streams(dummy):
|
|
| 210 |
|
| 211 |
return "All streams updated successfully!"
|
| 212 |
|
|
|
|
| 213 |
# Create Gradio interface
|
| 214 |
iface = gr.Interface(
|
| 215 |
fn=update_streams,
|
|
@@ -218,4 +219,5 @@ iface = gr.Interface(
|
|
| 218 |
)
|
| 219 |
|
| 220 |
# Launch the app
|
| 221 |
-
iface.launch()
|
|
|
|
|
|
| 192 |
}
|
| 193 |
|
| 194 |
# Function to run on button click
|
| 195 |
+
@webhook_endpoint # Define a unique endpoint URL
|
| 196 |
+
async def update_streams(payload: WebhookPayload):
|
| 197 |
speckle_token = os.environ.get("SPECKLE_TOKEN")
|
| 198 |
notion_token = os.environ.get("NOTION_TOKEN")
|
| 199 |
|
|
|
|
| 210 |
|
| 211 |
return "All streams updated successfully!"
|
| 212 |
|
| 213 |
+
"""
|
| 214 |
# Create Gradio interface
|
| 215 |
iface = gr.Interface(
|
| 216 |
fn=update_streams,
|
|
|
|
| 219 |
)
|
| 220 |
|
| 221 |
# Launch the app
|
| 222 |
+
iface.launch()
|
| 223 |
+
"""
|