Let the Luigi handler take care of removing some DB settings
so that command line can also remove them via same logic
This commit is contained in:
parent
de5a8fae7c
commit
4741ee0a7b
|
@ -211,38 +211,9 @@ class LuigiTaskView(MasterView):
|
|||
|
||||
def configure_remove_settings(self):
|
||||
super(LuigiTaskView, self).configure_remove_settings()
|
||||
app = self.get_rattail_app()
|
||||
model = self.model
|
||||
session = self.Session()
|
||||
|
||||
to_delete = session.query(model.Setting)\
|
||||
.filter(sa.or_(
|
||||
model.Setting.name == 'rattail.luigi.backfill.tasks',
|
||||
model.Setting.name == 'rattail.luigi.backfill_tasks',
|
||||
model.Setting.name.like('rattail.luigi.backfill.task.%.description'),
|
||||
model.Setting.name.like('rattail.luigi.backfill.%.description'),
|
||||
model.Setting.name.like('rattail.luigi.backfill.task.%.forward'),
|
||||
model.Setting.name.like('rattail.luigi.backfill.%.forward'),
|
||||
model.Setting.name.like('rattail.luigi.backfill.task.%.notes'),
|
||||
model.Setting.name.like('rattail.luigi.backfill.%.notes'),
|
||||
model.Setting.name.like('rattail.luigi.backfill.task.%.script'),
|
||||
model.Setting.name.like('rattail.luigi.backfill.%.script'),
|
||||
model.Setting.name.like('rattail.luigi.backfill.task.%.target_date'),
|
||||
model.Setting.name.like('rattail.luigi.backfill.%.target_date'),
|
||||
model.Setting.name == 'rattail.luigi.overnight.tasks',
|
||||
model.Setting.name == 'rattail.luigi.overnight_tasks',
|
||||
model.Setting.name.like('rattail.luigi.overnight.task.%.description'),
|
||||
model.Setting.name.like('rattail.luigi.overnight.%.description'),
|
||||
model.Setting.name.like('rattail.luigi.overnight.task.%.notes'),
|
||||
model.Setting.name.like('rattail.luigi.overnight.%.notes'),
|
||||
model.Setting.name.like('rattail.luigi.overnight.task.%.module'),
|
||||
model.Setting.name.like('rattail.luigi.overnight.task.%.class_name'),
|
||||
model.Setting.name.like('rattail.luigi.overnight.task.%.script'),
|
||||
model.Setting.name.like('rattail.luigi.overnight.%.script')))\
|
||||
.all()
|
||||
|
||||
for setting in to_delete:
|
||||
app.delete_setting(session, setting.name)
|
||||
self.luigi_handler.purge_overnight_settings(self.Session())
|
||||
self.luigi_handler.purge_backfill_settings(self.Session())
|
||||
|
||||
@classmethod
|
||||
def defaults(cls, config):
|
||||
|
|
Loading…
Reference in a new issue