Developer Journal: 27 April 2020
Posted on Mon 27 April 2020 in dev-journal
Working on creating a release for Conveyor that will implement the rq-gevent-worker and additional bug fixes.
Updated the rq-gevent-worker setup.py and added same documentation to the readme.
The original owner seems to have abandoned this project but I wanted to make sure the author stayed in the package so I updated the setup.py and made sure to add the original authors name.
from setuptools import setup
setup(
name='rq-gevent-worker',
version='0.2.1',
py_modules=['rq_gevent_worker'],
entry_points={
'console_scripts': [
'rq-gevent-worker=rq_gevent_worker:main',
]
},
url='https://github.com/mikeabrahamsen/rq-gevent-worker',
license='BSD',
author='Lyon Zhang, Michael Abrahamsen',
author_email='[email protected], [email protected]',
description='Implement a new worker based on gevent',
long_description=__doc__,
install_requires=['rq >= 1.2.2', 'gevent >= 20.4.0'],
)
With the rq-gevent-worker package in place, the current worker process will need to be changed on the server. Conveyor currently has support for RQ workers so I'm going to add in the ability to add a custom worker command into the worker creation for Conveyor.
I've created a simple test case to test this but will have to write the actual route to delete tomorrow:
@patch('app.models.launch_task')
def test_delete_removes_worker_from_db(self, mock_launch):
mock_launch.return_value = ""
login_user(self.client, email=self.user.email, password='password')
self.client.delete(self.base_url)
workers = SiteWorker.query.all()
self.assertEqual(len(workers), 0)
Design work
Had a few more design revisions today... currently working on this page of the CME claiming process. I like the idea of using the image on the right which allows the app to try to estimate the amount of credits a user has earned while also allowing for adjustments if that value is not correct.