main.js 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. // Code that is shared between client and server, i.e. sent to both.
  2. // main.js is loaded last:
  3. // http://docs.meteor.com/#/full/structuringyourapp
  4. // Methods that provide write access to the data.
  5. Meteor.methods({
  6. addComment: function (comment) {
  7. Meteor._debug("addComment method running", comment);
  8. // We are connected.
  9. if (this.userId) {
  10. comment.createdOn = new Date();
  11. comment.userId = this.userId;
  12. return Comments.insert(comment);
  13. }
  14. return null;
  15. },
  16. addDoc: function () {
  17. Meteor._debug("addDoc, this", this);
  18. // Not logged-in.
  19. if (!this.userId) {
  20. return;
  21. }
  22. else {
  23. let doc = {
  24. owner: this.userId,
  25. createdOn: new Date(),
  26. title: "my new doc"
  27. };
  28. const docid = Documents.insert(doc);
  29. return docid;
  30. }
  31. },
  32. // Changing doc privacy settings.
  33. updateDocPrivacy: function (doc) {
  34. Meteor._debug("updatedocPrivacy", this.userId, doc)
  35. if (!this.userId) {
  36. return;
  37. }
  38. let res = Documents.update({ _id: doc._id, owner: this.userId }, { $set: { isPrivate: doc.isPrivate } });
  39. Meteor._debug("update", res);
  40. },
  41. // Adding editors to a document.
  42. addEditingUser: function (docid) {
  43. let doc = Documents.findOne({ _id: docid });
  44. if (!doc) {
  45. // No doc: give up.
  46. return;
  47. }
  48. if (!this.userId) {
  49. // No logged-in user: give up.
  50. return;
  51. }
  52. // Now I have a doc and possibly a user.
  53. let user = Meteor.user().profile;
  54. let eUsers = EditingUsers.findOne({ docId: doc._id });
  55. // No editing users have been stored yet.
  56. if (!eUsers) {
  57. eUsers = {
  58. docId: doc._id,
  59. users: {}
  60. };
  61. }
  62. user.lastEdit = new Date();
  63. eUsers.users[this.userId] = user;
  64. // Upsert: insert or update if filter matches.
  65. EditingUsers.upsert({ _id: eUsers._id }, eUsers);
  66. }
  67. });
PANIC: session(release): write data/sessions/e/4/e457b6c005473764: no space left on device

PANIC

session(release): write data/sessions/e/4/e457b6c005473764: no space left on device
/my/cache/.heroku/go/go-path/pkg/mod/github.com/go-macaron/session@v1.0.3/session.go:204 (0xb13e07)
/my/cache/.heroku/go/go-path/pkg/mod/gopkg.in/macaron.v1@v1.5.1/context.go:80 (0x967b75)
/my/cache/.heroku/go/go-path/pkg/mod/github.com/go-macaron/inject@v0.0.0-20200308113650-138e5925c53b/inject.go:157 (0x9512ee)
/my/cache/.heroku/go/go-path/pkg/mod/github.com/go-macaron/inject@v0.0.0-20200308113650-138e5925c53b/inject.go:135 (0x951205)
/my/cache/.heroku/go/go-path/pkg/mod/gopkg.in/macaron.v1@v1.5.1/context.go:124 (0x967cc4)
/my/cache/.heroku/go/go-path/pkg/mod/gopkg.in/macaron.v1@v1.5.1/context.go:114 (0x967bf6)
/my/cache/.heroku/go/go-path/pkg/mod/gopkg.in/macaron.v1@v1.5.1/recovery.go:161 (0x15baec4)
/my/cache/.heroku/go/go-path/pkg/mod/gopkg.in/macaron.v1@v1.5.1/logger.go:40 (0x96b257)
/my/cache/.heroku/go/go-path/pkg/mod/github.com/go-macaron/inject@v0.0.0-20200308113650-138e5925c53b/inject.go:157 (0x9512ee)
/my/cache/.heroku/go/go-path/pkg/mod/github.com/go-macaron/inject@v0.0.0-20200308113650-138e5925c53b/inject.go:135 (0x951205)
/my/cache/.heroku/go/go-path/pkg/mod/gopkg.in/macaron.v1@v1.5.1/context.go:124 (0x967cc4)
/my/cache/.heroku/go/go-path/pkg/mod/gopkg.in/macaron.v1@v1.5.1/router.go:187 (0x972959)
/my/cache/.heroku/go/go-path/pkg/mod/gopkg.in/macaron.v1@v1.5.1/router.go:304 (0x973a01)
/my/cache/.heroku/go/go-path/pkg/mod/gopkg.in/macaron.v1@v1.5.1/macaron.go:218 (0x96c572)
/my/cache/.heroku/go/go1.26.3/go/src/net/http/server.go:3311 (0x85a5cd)
/my/cache/.heroku/go/go1.26.3/go/src/net/http/server.go:2073 (0x837f6f)
/my/cache/.heroku/go/go1.26.3/go/src/runtime/asm_amd64.s:1771 (0x493380)