Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Commit to SQLite missing in handler.py #165

Closed
pahenning opened this issue Jul 21, 2016 · 1 comment
Closed

Commit to SQLite missing in handler.py #165

pahenning opened this issue Jul 21, 2016 · 1 comment
Assignees
Milestone

Comments

@pahenning
Copy link

pahenning commented Jul 21, 2016

The published version of action/handler.py does not write into the SQLite database, since in does not contain proper commit statements. They have to be added to the code as follows:

def insert_event_log(self, event_id, fired_by, event_name, start_time, additional_infos):
        sql_statement = '''
        INSERT INTO event_log VALUES (
            "{event_id}","{fired_by}","{event_name}",{start_time},"{additional_infos}"
        );
        '''.format(
            event_id = event_id,
            fired_by = fired_by.replace('"', "'"),
            event_name = event_name.replace('"', "'"),
            start_time = start_time,
            additional_infos = str(additional_infos).replace('"', "'")
        )
        self.execute_sql(sql_statement)
        try: self._db.commit()
        except: pass
    def insert_action_log(self, event_id, action_name, start_time, action_result):
        sql_statement = '''
        INSERT INTO action_log VALUES (
            "{event_id}","{action_name}",{start_time},"{action_result}"
        );
        '''.format(
            event_id = event_id,
            action_name = action_name.replace('"', "'"),
            start_time = start_time,
            action_result = str(action_result).replace('"', "'")
        )
        self.execute_sql(sql_statement)
        try: self._db.commit()
        except: pass

Regards

pah

@motom001 motom001 self-assigned this Feb 23, 2022
@motom001 motom001 added this to the v2.6.0 milestone Feb 23, 2022
@motom001
Copy link
Owner

SQLite wird in den nächsten Versionen entfernt

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants