def finish(self, name: str):
        """Finish item

        Args:
            name: item name
        """
        with get_session(self.db_engine) as session:
            existed = session.query(SchedulerItem).filter_by(
                name=name, status=ItemStatus.ON.value).first()
            if not existed:
                return
            existed.status = ItemStatus.OFF.value
            try:
                session.commit()
            except Exception as e:  # pylint: disable=broad-except
                logging.error(f'[composer] failed to finish scheduler_item, '
                              f'name: {name}, exception: {e}')
                session.rollback()
Finish item

        Args:
            name: item name
        
web_console_v2/api/fedlearner_webconsole/composer/composer.py