Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
self_data_technical_doc
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
web-et-numerique
Factory
LLLE_Project
self_data_technical_doc
Commits
1e7912a6
Commit
1e7912a6
authored
4 years ago
by
Yoan VALLET
Browse files
Options
Downloads
Patches
Plain Diff
update service section
parent
3262b87c
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
docs/ecolyo/application/services.md
+20
-7
20 additions, 7 deletions
docs/ecolyo/application/services.md
with
20 additions
and
7 deletions
docs/ecolyo/application/services.md
+
20
−
7
View file @
1e7912a6
!!! warning ""
:construction: Section under Construction :construction:
## Cron Services
## Cron Services
In order to build an automated task within our cozy-stack, we can create
*services*
which are javascript files called from a trigger job.
In order to build an automated task within our cozy-stack, we can create
*services*
which are javascript files called from a trigger job.
...
@@ -15,12 +12,28 @@ File location is determined after the build, see [here](https://forge.grandlyon.
...
@@ -15,12 +12,28 @@ File location is determined after the build, see [here](https://forge.grandlyon.
!!! note "Cron"
!!! note "Cron"
See the cron definition at
[
cozy-stack
](
https://docs.cozy.io/en/cozy-stack/jobs/#cron-syntax
)
.
See the cron definition at
[
cozy-stack
](
https://docs.cozy.io/en/cozy-stack/jobs/#cron-syntax
)
.
##
# S
ervices
##
Ecolyo s
ervices
Located under
**src\targets\services**
Located under
**src\targets\services**
#### Monthly report notification
### Monthly report notification
#### Definition of the service
The service will run the 3rd of each month at 10.00 am, as defined in the manifest:
```
"monthlyReportNotification": {
"type": "node",
"file": "services/monthlyReportNotification/ecolyo.js",
"trigger": "@cron 0 0 10 3 * *"
}
```
#### Main responsabilities of the service
Fetches metadata
to
c
us
tomize
the
m
ail
(Public name, instance url)
.
The service is reponsible of sending a mail
to us
er to warn him about
the
av
ail
ability of a new information in the Analyse
.
Send mail containing a link to the user instance so that he can be warned about the update of its monthly report and visualize it.
Main steps are the following:
-
Check the "sendReportNotification" attribute in the com.grandlyon.ecolyo.profile doctype. If true, service will continue, else it will stop.
-
Fetches metadata to customize the mail (Public name, instance url).
-
Build the mail.
-
Send the mail.
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment