Esempio n. 1
0
    def _write_marker_to_db(self, new_marker):
        LOG.info('Updating marker in db to: %s', new_marker)
        marker = DumperMarker.get_all()

        if len(marker) > 1:
            LOG.exception(
                'More than one dumper marker found. Using first found one.')

        marker_db = None
        if marker:
            marker = marker[0]
            marker_db = DumperMarkerDB(id=marker['id'])
        else:
            marker_db = DumperMarkerDB()

        marker_db.marker = isotime.format(new_marker, offset=False)
        marker_db.updated_at = date_utils.get_datetime_utc_now()
        return DumperMarker.add_or_update(marker_db)
Esempio n. 2
0
 def _create_save_dumper_marker():
     created = DumperMarkerDB()
     created.marker = '2015-06-11T00:35:15.260439Z'
     created.updated_at = date_utils.get_datetime_utc_now()
     return DumperMarker.add_or_update(created)
 def _create_save_dumper_marker():
     created = DumperMarkerDB()
     created.marker = '2015-06-11T00:35:15.260439Z'
     created.updated_at = date_utils.get_datetime_utc_now()
     return DumperMarker.add_or_update(created)