Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Async export excel 12.0 #333

Merged
merged 10 commits into from
Jul 10, 2024
Merged

Async export excel 12.0 #333

merged 10 commits into from
Jul 10, 2024

Conversation

awu0403
Copy link
Contributor

@awu0403 awu0403 commented Jul 2, 2024

No description provided.

self.config = config

self._db_session_class = init_db_session_class(config)
self._redis_connection = RedisClient(config).connection
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

用到redis了吗

logger = logging.getLogger('seafevents')


def get_sys_logs_task(tstart, tend, log_type):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这部分代码有用吗?把没有的删掉

return make_response((error, 403))

if event_export_task_manager.tasks_queue.full():
logger.warning('seafile io server busy, queue size: %d, current tasks: %s, threads is_alive: %s'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

改成 seafevent server busy, 这里没有seafile io server

from sqlalchemy import desc, select, update, func, text, and_
from sqlalchemy.sql import exists
from .utils import write_xls, utc_to_local, generate_file_audit_event_type
from .export_task_manager import event_export_task_manager
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

改成从项目根目录导入吧

from .export_task_manager import event_export_task_manager
from flask import make_response
from seaserv import seafile_api, ccnet_api
import os
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个放到最上面,按照顺放,系统包,第三方包,项目内部的包

import ast

from sqlalchemy import desc, select, update, func, text, and_
from sqlalchemy.sql import exists
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个是没用的吧,检查一下是不是还有其他没有的,都去掉

logger = logging.getLogger('seafevents')


def query_status(task_id):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这下面的代码有用吗?

datetime.datetime.utcfromtimestamp(tend)))
stmt = stmt.order_by(desc(obj.timestamp))
res = session.scalars(stmt).all()
session.close()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

参考下dtable-events 中的代码,看下是怎么关闭的

event_export_task_manager.threads_is_alive()))
return make_response(('seafevent server busy,.', 400))

tstart = request.args.get('start_time')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

类似这样参数名都改一下,

孙永强 and others added 2 commits July 10, 2024 12:06
@freeplant freeplant merged commit ae3404e into 12.0 Jul 10, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants