修复偏移问题,修复代理问题
This commit is contained in:
@@ -17,6 +17,13 @@ huey_db_path = os.path.join(instance_dir, 'huey_queue.db')
|
||||
|
||||
huey = SqliteHuey(filename=huey_db_path)
|
||||
|
||||
def get_gcode_dir(app):
|
||||
with app.app_context():
|
||||
conf = SystemConfig.query.filter_by(key='gcode_upload_folder').first()
|
||||
if conf and conf.value and os.path.exists(conf.value):
|
||||
return conf.value
|
||||
return app.config['UPLOAD_FOLDER']
|
||||
|
||||
|
||||
@huey.task()
|
||||
def slice_stl_task(file_id, stl_filepath, quality_preset=None, infill_density=None, support_enable=None, support_pattern=None, delete_stl=False):
|
||||
@@ -31,7 +38,7 @@ def slice_stl_task(file_id, stl_filepath, quality_preset=None, infill_density=No
|
||||
|
||||
# Cache variables and commit slicing status
|
||||
gcode_filename = print_file.filename.rsplit('.', 1)[0] + '.gcode'
|
||||
gcode_filepath = os.path.join(app.config['UPLOAD_FOLDER'], gcode_filename)
|
||||
gcode_filepath = os.path.join(get_gcode_dir(app), gcode_filename)
|
||||
print_file.status = 'slicing'
|
||||
db.session.commit()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user