-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathproject.gcl
More file actions
29 lines (24 loc) · 882 Bytes
/
project.gcl
File metadata and controls
29 lines (24 loc) · 882 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
@library("std", "7.5.142-stable"); // explicitly set the version of GreyCat
@library("explorer", "7.5.8-stable"); // add the Explorer to the project
@include("backend"); // tell GreyCat to load modules from that directory
/// The project entrypoint
fn main() {
import_contracts(); // manually import contracts
import_stations(); // manually import stations
schedule_importers(); // schedule periodic imports
}
fn schedule_importers() {
// import stations every 5 minutes
Scheduler::add(importer::import_stations, FixedPeriodicity { every: 5min }, null);
// import contracts every day at midnight
Scheduler::add(importer::import_contracts, DailyPeriodicity {}, null);
}
/// Boostrap the data, for demo purposes
fn import_local_data() {
import_data();
import_records();
}
fn export_local_data() {
export_data();
export_records();
}