Coder Social home page Coder Social logo

感谢作者的修改,但进程结束后,所有历史记录全消失,包括文本,上传的文件全消失。 about cloud-clipboard HOT 10 CLOSED

transparentlc avatar transparentlc commented on August 17, 2024
感谢作者的修改,但进程结束后,所有历史记录全消失,包括文本,上传的文件全消失。

from cloud-clipboard.

Comments (10)

TransparentLC avatar TransparentLC commented on August 17, 2024

你是用什么方式结束进程的?

数据保存到本地(history.json)是在进程结束的时候进行的,用的是 async-exit-hook 这个库。

之前测试了在 Windows 下按 Ctrl+C 退出是可以保存的,用任务管理器结束的话就不会触发(async-exit-hook 的 README 里写了无法支持),Linux 下我还没测试过。

from cloud-clipboard.

sonicno1 avatar sonicno1 commented on August 17, 2024

linux下,按下kill终止进程,它就会消失。

from cloud-clipboard.

sonicno1 avatar sonicno1 commented on August 17, 2024

要是文本和文件的uuid能保存在sqllite本地数据库里就好了。

from cloud-clipboard.

sonicno1 avatar sonicno1 commented on August 17, 2024

这样终止进程也能保存

from cloud-clipboard.

sonicno1 avatar sonicno1 commented on August 17, 2024

感谢作者,试过了,能保存记录了,记录是以history.json格式保存。kill进程也能保存。

from cloud-clipboard.

sonicno1 avatar sonicno1 commented on August 17, 2024

长文本结束进程会消失,不能保存到json,希望能改进,用数据保存,sqlite或者mysql

from cloud-clipboard.

TransparentLC avatar TransparentLC commented on August 17, 2024

我试了一下,就算是发送了长度达到限制的文本也可以保存,即使手动修改 history.json 使文本的长度超过限制也可以正常读取。

使用数据库的话感觉太重了,暂无这方面的打算。

from cloud-clipboard.

sonicno1 avatar sonicno1 commented on August 17, 2024

我这边在linux环境试了,长文本或者图片发送后,在本地查看,并未写入history.json里。不知什么原因,它并保存到json文件里。进程终止后,所以未保存。

from cloud-clipboard.

TransparentLC avatar TransparentLC commented on August 17, 2024

长文本或者图片发送后,在本地查看,并未写入history.json里。

在 Ubuntu 22.04 试了一下,未能复现。

进程终止后,所以未保存。

确切来说是 SIGTERM 会触发结束时的保存操作,SIGKILL 就没办法触发了。另外如果你是下载 Actions 的打包版本的话,由于 caxa 的特性启动的时候实际上会创建 cloud-clipboard 和 node 两个进程,只有结束后者才会触发。算了我还是改成每次增删消息记录就保存一次好了。

from cloud-clipboard.

sonicno1 avatar sonicno1 commented on August 17, 2024

已经完美解决了存储的问题。给大佬加星

from cloud-clipboard.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.