wlhtea / Suno2openai

以openai格式调用suno api,并将cookie保存为数据库,实现cookie池调用 📈已接入newapi、oneapi中转站,适配chat-next-web等前端项目 || Call suno api in openai format, and save the cookie as a database to realize the cookie pool call to access newapi, oneapi relay station, adapting chat-next-web and other front-end projects
MIT License
220 stars 44 forks source link

🧩 解决并发问题,同时优化代码 #38

Closed Yanyutin753 closed 3 months ago

Yanyutin753 commented 3 months ago

本次PR的内容:

  1. 新增接口{COOKIES_PREFIX}/songID/cookies delete 用于还原cookies里的所有songIDsongID2
  2. 避免使用aiomysql的自动提交,改为手动提交,以适配事务
  3. 使用悲观锁加事务用于解决并发问题
  4. 优化代码结构,提高响应速度

已测试通过,可以通过yangclivia/suno2openai:latest镜像用于测试