This commit is contained in:
Will Hunt 2021-04-16 11:43:14 +01:00
parent f44456a5db
commit 60e6692c4f
3 changed files with 11 additions and 11 deletions

View File

@ -575,8 +575,8 @@ class PanClient(AsyncClient):
)
self.task = task
if self.pan_conf.sync_stop_after > 0:
self.last_sync_task = loop.create_task(self.can_stop_sync())
# if self.pan_conf.sync_stop_after > 0:
# self.last_sync_task = loop.create_task(self.can_stop_sync())
return task

View File

@ -39,8 +39,8 @@ class PanConfigParser(configparser.ConfigParser):
"IndexingBatchSize": "100",
"HistoryFetchDelay": "3000",
"DebugEncryption": "False",
"SyncOnStartup": "True",
"StopSyncingTimeout": "0"
"SyncOnStartup": "False",
"StopSyncingTimeout": "600"
},
converters={
"address": parse_address,
@ -143,8 +143,8 @@ class ServerConfig:
index_encrypted_only = attr.ib(type=bool, default=True)
indexing_batch_size = attr.ib(type=int, default=100)
history_fetch_delay = attr.ib(type=int, default=3)
sync_on_startup = attr.ib(type=bool, default=True)
sync_stop_after = attr.ib(type=int, default=0)
sync_on_startup = attr.ib(type=bool, default=False)
sync_stop_after = attr.ib(type=int, default=600)
@attr.s
@ -212,8 +212,8 @@ class PanConfig:
indexing_batch_size = section.getint("IndexingBatchSize")
sync_on_startup = section.getboolean("SyncOnStartup")
sync_stop_after = section.getint("SyncStopAfter")
sync_on_startup = False #section.getboolean("SyncOnStartup")
sync_stop_after = 600 #section.getint("SyncStopAfter")
if not 1 < indexing_batch_size <= 1000:
raise PanConfigError(

View File

@ -924,8 +924,8 @@ class ProxyDaemon:
# The room isn't encrypted just forward the message.
if not encrypt:
content_msgtype = content["msgtype"]
if content_msgtype in ["m.image", "m.video", "m.audio", "m.file"] or msgtype == "m.room.avatar":
content_msgtype = content.get("msgtype")
if content_msgtype is not None and content_msgtype in ["m.image", "m.video", "m.audio", "m.file"] or msgtype == "m.room.avatar":
try:
content = await self._map_decrypted_uri("url", content, request, client)
return await self.forward_to_web(request, data=json.dumps(content), token=client.access_token)
@ -940,7 +940,7 @@ class ProxyDaemon:
async def _send(ignore_unverified=False):
try:
content_msgtype = content["msgtype"]
content_msgtype = content.get("msgtype")
if content_msgtype in ["m.image", "m.video", "m.audio", "m.file"] or msgtype == "m.room.avatar":
upload_info, media_info = self._get_upload_and_media_info("url", content)
if not upload_info or not media_info: