mirror of
https://gitlab.ub.uni-bielefeld.de/sfb1288inf/nopaque.git
synced 2025-06-12 17:10:41 +00:00
Make the app arg in @background functions a bit less magical
This commit is contained in:
@ -7,7 +7,8 @@ import shutil
|
||||
|
||||
|
||||
@background
|
||||
def build_corpus(app, corpus_id):
|
||||
def build_corpus(corpus_id, *args, **kwargs):
|
||||
app = kwargs['app']
|
||||
with app.app_context():
|
||||
corpus = Corpus.query.get(corpus_id)
|
||||
if corpus is None:
|
||||
@ -48,7 +49,8 @@ def build_corpus(app, corpus_id):
|
||||
|
||||
|
||||
@background
|
||||
def delete_corpus(app, corpus_id):
|
||||
def delete_corpus(corpus_id, *args, **kwargs):
|
||||
app = kwargs['app']
|
||||
with app.app_context():
|
||||
corpus = Corpus.query.get(corpus_id)
|
||||
if corpus is None:
|
||||
@ -60,7 +62,8 @@ def delete_corpus(app, corpus_id):
|
||||
|
||||
|
||||
@background
|
||||
def delete_corpus_file(app, corpus_file_id):
|
||||
def delete_corpus_file(corpus_file_id, *args, **kwargs):
|
||||
app = kwargs['app']
|
||||
with app.app_context():
|
||||
corpus_file = CorpusFile.query.get(corpus_file_id)
|
||||
if corpus_file is None:
|
||||
|
Reference in New Issue
Block a user