Moises Henriquez avatar Moises Henriquez committed 5139163

Fixed sqlite timestamp out of sync bug

Comments (0)

Files changed (1)

src/vpackager/dbutils.py

         create table history(id integer primary key,
         app text, ver text, srcURI text, descURI text,
         release text, type text, config_options text,
-        doinstURI text, patches text, buildstart text,
-        buildend text, stdout text, result text)''')
+        doinstURI text, patches text, buildstart timestamp,
+        buildend timestamp, stdout text, result text)''')
         db.commit()
 
         return self.close()
         cursor.execute('''
         insert into history (id, app, ver, srcURI, descURI, release, type,
         config_options, doinstURI, buildstart, result)
-        values (?,?,?,?,?,?,?,?,?,CURRENT_TIMESTAMP, 'Running')''', res)
+        values (?,?,?,?,?,?,?,?,?,datetime(CURRENT_TIMESTAMP, 'localtime'), 'Running')''', res)
         cursor.execute('delete from queue where id=?', t)
         db.commit()
         # Notify the observers of the changes.
         db, cursor = self._open()
         t = (stdoutpath, result, job_id)
         cursor.execute('''
-            UPDATE history SET buildend=CURRENT_TIMESTAMP,
+            UPDATE history SET buildend=datetime(CURRENT_TIMESTAMP, 'localtime'),
             stdout=?, result=? WHERE id=?''', t)
         db.commit()
         self.notify(data = self.GetHistory(), group='history')
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.