Welcome Guest, Not a member yet? Register   Sign In
Attendance Process Taking Too long
#1

I am working on a attendance management system, It gets data from device and saves it on a table (this part is fine since i dont have to do anything for this the device api does it for me.) . What I have to do is process the data and get attendance sheet. In between that I have to visit through quite a lot of table and do a lots of looping. My senior already did all that and has left the company. But now comes the problem I have to change somethings in it. like make 2 days weekend and stuffs like that, well this part is not that hard. The hard part is that when I run the function it takes quite a lot of time. If a company has 100 users and have to process 1 months data it takes around 2 - 3 hours. What the function is currently doing is:-
1. Looping through all employees.
2. Get all devices for that company
3. getting employee data from devicelog table ( which the device sends and saves data to) filtering by from and to date
4. looping through the data from 3 and getting data based on shift
5. looping through the shift data to get checkin time checkout time , present, absent, weekend, holiday, leave
6. weekend, holiday, leave have their own function that checks which is which

and there are some functionality inbetween. and after that the finally processed data is saved to attendance table. The function starts at line 41 and ends in line 681. Any good tips on how to tackle it.
Reply


Messages In This Thread
Attendance Process Taking Too long - by lazyme114 - 04-12-2022, 12:57 AM



Theme © iAndrew 2016 - Forum software by © MyBB