Fixed pkexec

Removed "optimizeTable" for stats (nonsense...)
"
This commit is contained in:
Adolfo Gómez García 2019-02-11 11:13:12 +01:00
parent 683728fbc1
commit 6889098ec8
4 changed files with 4 additions and 19 deletions

View File

@ -1,2 +1,3 @@
#!/bin/sh
pkexec "/usr/sbin/UDSActorConfig" "$@"
# pkexec env DISPLAY=$DISPLAY QT_X11_NO_MITSHM=1 "/usr/sbin/UDSActorConfig" "$@"
pkexec "/usr/sbin/UDSActorConfig" "$@"

View File

@ -35,7 +35,6 @@ from uds.core.util.Config import GlobalConfig
from uds.models import StatsCounters
from uds.models import getSqlDatetime
from uds.models import StatsEvents
from uds.models import optimizeTable
import datetime
import time
import six
@ -70,9 +69,6 @@ class StatsManager(object):
# Newer Django versions (at least 1.7) does this deletions as it must (executes a DELETE FROM ... WHERE...)
model.objects.filter(stamp__lt=minTime).delete()
# Optimize mysql tables after deletions
optimizeTable(model._meta.db_table)
# Counter stats
def addCounter(self, owner_type, owner_id, counterType, counterValue, stamp=None):
"""

View File

@ -40,7 +40,7 @@ from time import mktime
import logging
__updated__ = '2018-02-16'
__updated__ = '2019-02-11'
logger = logging.getLogger(__name__)
@ -91,14 +91,3 @@ def getSqlFnc(fncName):
return { 'CEIL': 'CEILING'}.get(fncName, fncName)
return fncName
def optimizeTable(dbTable):
"""
Executes table optimization
Supported only on mysql right now
"""
cursor = connection.cursor()
if connection.vendor == 'mysql':
cursor.execute('OPTIMIZE TABLE {0}'.format(dbTable))

View File

@ -39,7 +39,6 @@ from .Permissions import Permissions
# Utility
from .Util import getSqlDatetime
from .Util import optimizeTable
from .Util import NEVER
from .Util import NEVER_UNIX
@ -113,7 +112,7 @@ from .Tag import Tag
# Utility
from .DBFile import DBFile
__updated__ = '2018-09-28'
__updated__ = '2019-02-11'
logger = logging.getLogger(__name__)