Skip to content

Commit

Permalink
release 0.0.9
Browse files Browse the repository at this point in the history
  • Loading branch information
Clouder0 committed Apr 9, 2022
1 parent 4d16d96 commit 3d52efc
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 4 additions & 0 deletions SiyuanYuque/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
from . import config
import time
import regex
import aiohttp


yuque = Yuque(api_host=conf["api_host"], user_token=conf["user_token"])
Expand Down Expand Up @@ -82,6 +83,8 @@ async def handle_custom_sync(sync):


async def execute():
session = aiohttp.ClientSession()
siyuan.set_session(session)
start_time = time.perf_counter()
all_blocks = await siyuan.query_sql("SELECT * FROM blocks WHERE id IN ( SELECT block_id FROM attributes AS a WHERE a.name ='custom-yuque' AND a.value = 'true') AND type='d' AND updated>'{}'".format(conf["last_sync_time"]))
tasks = [asyncio.create_task(handle_block(x)) for x in all_blocks]
Expand All @@ -93,6 +96,7 @@ async def execute():
config.write_conf()
end_time = time.perf_counter()
print("Finished. Total time: {}s.".format(end_time - start_time))
await session.close()


if __name__ == "__main__":
Expand Down
4 changes: 2 additions & 2 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[metadata]
name = SiyuanYuque
version = 0.0.8
version = 0.0.9
author = Clouder
author_email = [email protected]
description = Sync SiYuan with Yuque
Expand All @@ -20,6 +20,6 @@ install_requires =
yuque-py
toml
aiohttp
siyuanhelper
siyuanhelper >= 0.0.3
regex
python_requires = >=3.6

0 comments on commit 3d52efc

Please sign in to comment.