Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
B
belenios
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
1
Issues
1
List
Boards
Labels
Service Desk
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
belenios
belenios
Commits
3b8c71f5
Commit
3b8c71f5
authored
Oct 22, 2015
by
Stephane Glondu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add a cache to find_election
parent
e4e4f7b5
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
1 deletion
+12
-1
src/web/web_site.ml
src/web/web_site.ml
+12
-1
No files found.
src/web/web_site.ml
View file @
3b8c71f5
...
...
@@ -83,10 +83,21 @@ let web_election_data (raw_election, web_params) =
end
in
(
module
D
:
WEB_ELECTION_DATA
)
let
find_election
uuid
=
let
raw_
find_election
uuid
=
lwt
x
=
Ocsipersist
.
find
election_ptable
uuid
in
return
(
web_election_data
x
)
module
WCacheTypes
=
struct
type
key
=
string
type
value
=
(
module
WEB_ELECTION_DATA
)
end
module
WCache
=
Ocsigen_cache
.
Make
(
WCacheTypes
)
let
find_election
=
let
cache
=
new
WCache
.
cache
raw_find_election
100
in
fun
x
->
cache
#
find
x
(* Mutex to avoid simultaneous registrations of the same election *)
let
registration_mutex
=
Lwt_mutex
.
create
()
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment