Skip to content

Commit 47a9ffe

Browse files
authored
Merge pull request #216 from Geode-solutions/fix/upload_folder
Fix/upload folder
2 parents 3b4cac8 + c041819 commit 47a9ffe

File tree

2 files changed

+4
-12
lines changed

2 files changed

+4
-12
lines changed

requirements.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,4 +60,3 @@ werkzeug==3.1.2
6060
# flask
6161
# flask-cors
6262

63-
opengeodeweb-microservice==1.*,>=1.0.14

src/opengeodeweb_back/app.py

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -24,16 +24,14 @@ def create_app(name: str) -> flask.Flask:
2424
)
2525
if FLASK_DEBUG == False:
2626
app.config.from_object(app_config.ProdConfig)
27-
else:
28-
app.config.from_object(app_config.DevConfig)
29-
30-
if FLASK_DEBUG == False:
3127
SECONDS_BETWEEN_SHUTDOWNS: float = float(
3228
app.config.get("SECONDS_BETWEEN_SHUTDOWNS") or 60.0
3329
)
3430
utils_functions.set_interval(
3531
utils_functions.kill_task, SECONDS_BETWEEN_SHUTDOWNS, app
3632
)
33+
else:
34+
app.config.from_object(app_config.DevConfig)
3735

3836
@app.before_request
3937
def before_request() -> flask.Response | None:
@@ -134,7 +132,7 @@ def run_server(app: Flask) -> None:
134132
"-ufp",
135133
"--upload_folder_path",
136134
type=str,
137-
default=app.config.get("DEFAULT_DATA_FOLDER_PATH"),
135+
default=app.config.get("UPLOAD_FOLDER"),
138136
help="Path to the folder where uploads are stored",
139137
)
140138
parser.add_argument(
@@ -157,12 +155,7 @@ def run_server(app: Flask) -> None:
157155
app.config.update(UPLOAD_FOLDER=args.upload_folder_path)
158156
app.config.update(MINUTES_BEFORE_TIMEOUT=args.timeout)
159157
flask_cors.CORS(app, origins=args.allowed_origins)
160-
print(
161-
f"Host: {args.host}, Port: {args.port}, Debug: {args.debug}, "
162-
f"Data folder path: {args.data_folder_path}, Timeout: {args.timeout}, "
163-
f"Origins: {args.allowed_origins}",
164-
flush=True,
165-
)
158+
print(f"{args=}", flush=True)
166159

167160
db_filename: str = app.config.get("DATABASE_FILENAME") or "project.db"
168161
db_path = os.path.join(str(args.data_folder_path), db_filename)

0 commit comments

Comments
 (0)