Coder Social home page Coder Social logo

enmap-rethink's Introduction

Alterion's Github

eslachance github profile views Discord server Patreon

Hello my darlings and welcome to Alterion.Dev's Github Profile! You're here because you're curious about who I am and what I do - or maybe you're a potential employer and you're sleuthing through my stuff and figuring out if I can write good code? Either way, hello and thanks for visiting.

So, what is there to see here? Well, there's my super cool projects like Enmap and Josh that I'm currently working on. Enmap is feature-complete while Josh is more of a work in progress, a different implementation with features I can't do with Enmap. Also take a look at Snowflake which is a blogging platform made with React, Zustand, react-router-dom and Snowpack.

In the past, I've worked a lot on Discord bots using the Discord.js library to interact with the API itself. It's how I learned to extend my existing Javascript knowledge into the ES6+ era by creating bots like Etiket as well as the now defunct Komada framework and boilerplates like Guidebot. I also contributed most of An Idiot's Guide and created videos on my youtube channel over the years.

Want to chat me up? Join My Discord! You can also get me on Twitter and Facebook but to be honest, I don't usually check those regularly.

Wanna hire me? Connect on LinkedIn now!

Github Stats

Provided by GitHub Readme Stats

enmap-rethink's People

Contributors

eslachance avatar jmiln avatar kyranet avatar yorkaargh avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

enmap-rethink's Issues

Rethink loses all data on restart.

So I was trying to use Enmap Rethink for a Discord bot. All was going well, easy conversion from Mongo. But there was one problem, which you can see from the title. When I restarted the bot on Linux (mentioning that since it may be a linux issue?) the DB was empty. The bot found out that the guild info wasn't saved, and reset it to default. Why does it empty on restart?

multi process read from db issue

Hi,
I'm using this module to store some JSON data that i have in memory to rethinkdb but am having an issue with multiple processes.
When I get, modify, then set, it works great in writing to DB. But it seems like when using multiple processes (using pm2 cluster mode of a node app i wrote), each process only reads the db tuples once, modifies in memory with the get/set methods and writes what changed to the DB.
This means if I have a DB for caching purposes of some data, one worker will .set, but the others do not read from the db when doing the next .get on the same key.

e.g.
worker 1
someEnmap.set(1, "apple"); someEnmap.get(1); // => "apple"
worker 2 (after writing to DB has occured)
someEnmap.get(1); // => undefined

Should I just be interacting with the databse directly intead? Also, wouldn't this mean that if I'm using enmap for a discord bot, different shards would load the entire database into memory rather than just getting data it needs per shard, resulting in high memory use?

Kind regards.

All users have the same data

Hello, the issue description is in 2 language, the first, very well explained (in French) but the 2nd, done with google translation :(

1 in French :
Bonjour, j'ai un problème avec enmap, je stock la donnée comme ceci :
EnmapMoney.math("number", "add", 100);
(Ceci est un exemple !) Mais, le problème est que ça stocke la donnée pour tout les utilisateurs, je veux que ça stocke que pour l'author (c'est un bot discord !)
Et, c'est qu'il n'y a aucune explication que j'ai trouvé dans la documentation :/ voilà pourquoi j'ai besoin d'aide !

Merci d'avance 👍 !

2 in English :

Hello, I have a problem with enmap, I store the data like this:
   EnmapMoney.math ("number", "add", 100);
(This is an example!) But, the problem is that it stores the data for all users, I want it to store only for the author (it's a bot discord!)
And, there is no explanation that I found in the documentation: / that's why I need help!

Thanks in advance 👍!

Cannot read property 'insert' of undefined

My app.js script always fails on the first run, when having a fresh rethink database. If I run my script once, then shut it down, then reload, everything seems to run just fine.

const Enmap = require('enmap');
const EnmapRethink = require('enmap-rethink');
var playerDB = [];

const playerAPI = new EnmapRethink({
  name: 'players',
  dbName: 'PLAYERSDB',
});

playerDB[0] = new Enmap({provider: playerAPI, persistent: true});

Then >

bot.on('ready', () => {
 createLibrary();
});

function createLibrary() {
  playerDB[0].set('foundPlayers', 0);
}

Even though i read from a get within the bot.on to decide if it exists or not, the error only calls up in the function (the line with set, any set in that function). I've tried making the function sync & async, passing playerDB in the call, using try/catch; Nothing changes, but it's only on the first time. If I restart the script after it's ran once with the rethink server up, it loads fine. I'm just not sure how to fix it?

It's hard to reproduce errors (still learning): I change something about the DB, I delete the rethink server data folder (remove clutter from the changed DB setup), run the rethink server, load the script and let it error, shut down the script, reload the script -- then no 'Insert' issue.

Also the reason I'm posting this issue here, I'm not sure how widely used Enmap-Rethink is, I assumed this would be the fastest way to get some help. I've attached app.js to this issue (in issue_file.zip), so the full scope is there. There is no sensitive code information.

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.