mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2024-10-01 11:49:51 -04:00
drop undocumented dependency on dateutil (#4266)
It turns out we were relying on dateutil being pulled in transitively by pysaml2. There's no need for that bloat.
This commit is contained in:
parent
e8d98466b0
commit
9a3e24a13d
1
changelog.d/4266.misc
Normal file
1
changelog.d/4266.misc
Normal file
@ -0,0 +1 @@
|
|||||||
|
drop undocumented dependency on dateutil
|
@ -14,12 +14,10 @@
|
|||||||
# See the License for the specific language governing permissions and
|
# See the License for the specific language governing permissions and
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
|
|
||||||
import datetime
|
import calendar
|
||||||
import logging
|
import logging
|
||||||
import time
|
import time
|
||||||
|
|
||||||
from dateutil import tz
|
|
||||||
|
|
||||||
from synapse.api.constants import PresenceState
|
from synapse.api.constants import PresenceState
|
||||||
from synapse.storage.devices import DeviceStore
|
from synapse.storage.devices import DeviceStore
|
||||||
from synapse.storage.user_erasure_store import UserErasureStore
|
from synapse.storage.user_erasure_store import UserErasureStore
|
||||||
@ -357,10 +355,11 @@ class DataStore(RoomMemberStore, RoomStore,
|
|||||||
"""
|
"""
|
||||||
Returns millisecond unixtime for start of UTC day.
|
Returns millisecond unixtime for start of UTC day.
|
||||||
"""
|
"""
|
||||||
now = datetime.datetime.utcnow()
|
now = time.gmtime()
|
||||||
today_start = datetime.datetime(now.year, now.month,
|
today_start = calendar.timegm((
|
||||||
now.day, tzinfo=tz.tzutc())
|
now.tm_year, now.tm_mon, now.tm_mday, 0, 0, 0,
|
||||||
return int(time.mktime(today_start.timetuple())) * 1000
|
))
|
||||||
|
return today_start * 1000
|
||||||
|
|
||||||
def generate_user_daily_visits(self):
|
def generate_user_daily_visits(self):
|
||||||
"""
|
"""
|
||||||
|
Loading…
Reference in New Issue
Block a user