supercharge / mongodb-github-action

Use MongoDB in GitHub Actions
MIT License
224 stars 46 forks source link

[Bug/Feature Request?] #9

Closed DanMossa closed 4 years ago

DanMossa commented 4 years ago

Hello!

I'm currently using this github action with

    - name: Start MongoDB
      uses: supercharge/mongodb-github-action@1.3.0
      with:
        mongodb-version: '4.2'

I'm also using mongoose and everything works great except that one part of my code sets the ttlMonitorSleepSecs in mongo and this works locally but I don't believe it's working via github actions

  const ttlMonitorSleepSecs = config.get('time').ttlMonitorSleepSecs;
    await mongoose.connect(database);
    logger.info('mongooseInitSuccess', `MongoDB database connection established successfully`);

    await mongoose.connection.db.admin().command({ setParameter: 1, ttlMonitorSleepSecs });
    await mongoose.connection.db.admin().command({ setParameter: 1, ttlMonitorEnabled: false });
    await mongoose.connection.db.admin().command({ setParameter: 1, ttlMonitorEnabled: true });

    logger.info('mongooseInitChangeTTL', `Successfully changed ttlMonitorSleepSecs to ${ttlMonitorSleepSecs}`);

In this case, ttlMonitorSleepSecs is set to 1 during sets. I'm not sure if I'm either not setting this up correctly or if this isn't a support feature at the moment?

Thanks!

marcuspoehls commented 4 years ago

@DanMossa please give me some time to think this through. I'll have a look at this over the weekend and check whether it's a bug or feature in the action 😃

marcuspoehls commented 4 years ago

@DanMossa Hey Daniel, I've added a new branch containing a test to check whether the MongoDB configurations are set properly. The test is green and showing that the MongoDB instance can be configured.

Can you please have a look at the test and if it describes what you're looking for? https://github.com/supercharge/mongodb-github-action/compare/mongodb-configurations?expand=1

marcuspoehls commented 4 years ago

@DanMossa Hey Daniel, did you have time to check the sample code I provided? Does it relate to your issue?