Spaces:
Sleeping
Sleeping
pjgerrits
commited on
Commit
·
0669452
1
Parent(s):
2a88309
change cache
Browse files
app.py
CHANGED
|
@@ -8,12 +8,13 @@ import os
|
|
| 8 |
# Set the page layout
|
| 9 |
st.set_page_config(layout="wide")
|
| 10 |
|
| 11 |
-
|
| 12 |
# def connect_to_db():
|
| 13 |
# return psycopg2.connect(**st.secrets["postgres"])
|
| 14 |
|
| 15 |
|
| 16 |
# Function to connect to the database
|
|
|
|
| 17 |
def connect_to_db():
|
| 18 |
try:
|
| 19 |
conn = psycopg2.connect(
|
|
@@ -92,4 +93,4 @@ clicked_lon = coords[0] # Default value, should ideally be updated on map click
|
|
| 92 |
|
| 93 |
if st.sidebar.button('Save'):
|
| 94 |
save_data(clicked_lat, clicked_lon, description, rating)
|
| 95 |
-
|
|
|
|
| 8 |
# Set the page layout
|
| 9 |
st.set_page_config(layout="wide")
|
| 10 |
|
| 11 |
+
|
| 12 |
# def connect_to_db():
|
| 13 |
# return psycopg2.connect(**st.secrets["postgres"])
|
| 14 |
|
| 15 |
|
| 16 |
# Function to connect to the database
|
| 17 |
+
@st.cache_resource
|
| 18 |
def connect_to_db():
|
| 19 |
try:
|
| 20 |
conn = psycopg2.connect(
|
|
|
|
| 93 |
|
| 94 |
if st.sidebar.button('Save'):
|
| 95 |
save_data(clicked_lat, clicked_lon, description, rating)
|
| 96 |
+
|