Skip to content

Commit

Permalink
Merge pull request #17 from gri38/dev
Browse files Browse the repository at this point in the history
start background sync at the right place (don't disturb collectstatic…
  • Loading branch information
gri38 authored Jun 11, 2021
2 parents be6e38b + b684448 commit 6e20f38
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 17 deletions.
15 changes: 0 additions & 15 deletions joplin_vieweb/apps.py
Original file line number Diff line number Diff line change
@@ -1,21 +1,6 @@
from django.apps import AppConfig
import time
from django.conf import settings
from .utils import start_synchronize_joplin


class JoplinviewebConfig(AppConfig):
default_auto_field = 'django.db.models.BigAutoField'
name = 'joplin_vieweb'

def __init__(self, app_name, app_module):
AppConfig.__init__(self, app_name, app_module)
self.sync_task_launched = False

# def ready(self):
# if not self.sync_task_launched:
# self.sync_task_launched = True
# start_synchronize_joplin()
# # if you're running your app, using the python manage.py runserver command on Django, your application will run twice: One time to validate your models, and the other one to run your app.
# # You can change this passing the option --noreload to the runserver command
# # => to test synchro, run with --noreload to avoid 2 // synchro.
6 changes: 5 additions & 1 deletion joplin_vieweb/urls.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from django.urls import path

from .utils import start_synchronize_joplin
from . import views

app_name = 'joplin'
Expand All @@ -21,3 +21,7 @@
path('sync/', views.sync_data, name='get synch data'),
path('sync/do', views.do_sync, name='joplin synchro'),
]


# One time launched code
start_synchronize_joplin()
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[metadata]
name = django-joplin_vieweb
version = 1.5
version = 1.6
author = gri38
author_email = [email protected]
description = A Django app to view your Joplin notes online.
Expand Down

0 comments on commit 6e20f38

Please sign in to comment.