mirror of
https://gitlab.archlinux.org/archlinux/aurweb.git
synced 2025-02-03 10:43:03 +01:00
git-interface: Do not use UNIX_TIMESTAMP
Avoid using UNIX_TIMESTAMP which is not part of the SQL standard. Retrieve the current UNIX time in Python and substitute it into the SQL queries instead. Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
This commit is contained in:
parent
27631f1157
commit
f2a6bd207d
2 changed files with 7 additions and 4 deletions
|
@ -5,6 +5,7 @@ import pygit2
|
|||
import re
|
||||
import subprocess
|
||||
import sys
|
||||
import time
|
||||
|
||||
import srcinfo.parse
|
||||
import srcinfo.utils
|
||||
|
@ -70,9 +71,10 @@ def save_metadata(metadata, conn, user):
|
|||
user_id = int(cur.fetchone()[0])
|
||||
|
||||
# Update package base details and delete current packages.
|
||||
conn.execute("UPDATE PackageBases SET ModifiedTS = UNIX_TIMESTAMP(), " +
|
||||
now = int(time.time())
|
||||
conn.execute("UPDATE PackageBases SET ModifiedTS = ?, " +
|
||||
"PackagerUID = ?, OutOfDateTS = NULL WHERE ID = ?",
|
||||
[user_id, pkgbase_id])
|
||||
[now, user_id, pkgbase_id])
|
||||
conn.execute("UPDATE PackageBases SET MaintainerUID = ? " +
|
||||
"WHERE ID = ? AND MaintainerUID IS NULL",
|
||||
[user_id, pkgbase_id])
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue